How to set a default dag trigger configuration json

Viewed 3540

When triggering a dag in airflow, there is a window, with which I am able to parameters to the dag in a json format. This looks like the following: enter image description here

This json is always empty and I do have to know which parameters I can pass to the dag. Instead I would like to be able to prefill this json, so that when another user tries to trigger the dag he can simply change to values of the json, instead of having to look at the dags code first.

Is there any way to do this in the current version (2.0.0) of airflow?

3 Answers

On Airflow 2.1.0 it is possible to set default arguments as follow:

dag = DAG(dag_id="my_dag",
          schedule_interval=None,
          default_args={'retries': 3, 'retry_delay': timedelta(seconds=20)},
          catchup=False,
          tags=['maintenance'],
          params={"description": ""}  #Set parameters as a dictionary
)

In the thrigger UI it looks like this:
enter image description here

No, it is currently not supported -- at least for Airflow 2.0.0

Related