Stephen
Stephen

Reputation: 8790

Submitting configuration when triggering an Airflow DAG: What does it do?

When you trigger an Airflow DAG either through the UI (see screenshot) or the API (https://airflow.apache.org/docs/stable/rest-api-ref.html), you have the option of submitting a JSON configuration. However the usefulness of this isn't clearly documented as far as I can tell. I have two basic questions:

Here is the screenshot where you can provide configuration when triggering a DAG:

enter image description here

Upvotes: 3

Views: 2449

Answers (1)

Debasis Mitra
Debasis Mitra

Reputation: 92

Yes it is intended for Application level configuration.

Example -

{"appConfig":"Test"}

To read it in your DAG

def read_app_configuration(**kwargs):
    print("Read App Config - Task : Start")
    dag_run = kwargs['dag_run']
    region = kwargs['dag_run'].conf.get('appConfig')

Upvotes: 3

Related Questions