Search code examples
airflowairflow-scheduler

Airflow: Trigger DAG via UI with Parameters/Config


I see that one can trigger_dag with parameters/config key-value pairs using the airflow command line:

For Apache Airflow, How can I pass the parameters when manually trigger DAG via CLI?

In my case, I would like to centralize all operations for airflow via the airflow UI (preferably no CLI access should be granted), which has a button for triggering the dags:

enter image description here

How can I pass the external parameters/configs via the UI?


Solution

  • You're in luck, assuming you're on a recent version of Airflow or can upgrade. Support for triggering a DAG run with a config blob was added in Airflow 1.10.8 under AIRFLOW-5843 in #5843. It's not through the same Trigger DAG icon you've pointed to, but it's through creating a DAG Run from Browse->DAG Runs->Create.

    Screenshot of the new form that supports conf copied below from the pull request that added it.

    Add DAG Run

    The form will also validate the JSON of the conf which may actually be a step beyond the CLI.