Command Line Option to Activate Airflow DAGs

Viewed 2928

We have a continuous integration pipeline which automatically deploys our Airflow DAGs to the Airflow server. When a new version of a DAG is deployed, its status is OFF by default. We would like to turn it ON as part of the tasks executed by the deployment process.

Is there a command line option in Airflow which allows to turn ON a DAG? Thank you

2 Answers

Ok it seems I did not look carefully enough. The answer is just here in Airflow Documentation

You can turn OFF a DAG with the following command:

$ airflow pause <dag_id>

You can turn ON a DAG with the following command:

$ airflow unpause <dag_id>

Update: The command airflow unpause has been removed.

You should now use

$ airflow dags unpause <dag_id>

instead of

$ airflow unpause <dag_id>

When you say new version, I am assuming you change the DAG_ID, have you consider to update the airflow.cfg to dags_are_paused_at_creation = False?

Related