简体   繁体   中英

How to auto activate DAGS in airflow

I'm new to airflow and I wonder how can I have DAGs to auto-activate after being loaded.

在此处输入图片说明

I mean the switches, they are off by default

For All Dags :

Change dags_are_paused_at_creation to False in airflow.cfg .

You will find it in [core] section.

[core]
# Are DAGs paused by default at creation
dags_are_paused_at_creation = False

Single DAG : If you do not want to change it for all DAGs, you can set is_paused_upon_creation=True when creating DAG object.

Example:

dag = DAG(
    DAG_NAME, 
    schedule_interval='*/10 * * * *', 
    default_args=default_args, 
    is_paused_upon_creation=True)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM