Airflow & DAGs · Advanced Development

Passing parameters on manual trigger

Mediumconftriggerjinja

Interview question

How do you pass parameters during a manual DAG trigger?

How to answer

The short answer

Trigger with configuration :

JSON
{ "customer_id": 123, "environment": "prod" }

Access via run conf, often with Jinja:

JINJA
{{ dag_run.conf["customer_id"] }}

Watch missing keys: optional values can blow up if you access them unsafely.