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
'trigger_dag' triggers a DAG run. That is, if the DAG is unpaused, the command will initiate a dag run. However, the DAG state is paused by default.
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>
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
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With