Airflow unpause per-dag in definition

Viewed 1098

Is there any way to leave the server default..

dags_are_paused_at_creation = True

... but for one particular dag define it as unpaused by default ?

dag = DAG(
    dag_id=MISC_DAG_ID,
    default_args=default_args,
    params=params,
    schedule_interval=None,
    concurrency=1,
    max_active_runs=1,
    is_paused=False
)
2 Answers

from the documentation

is_paused_upon_creation (bool or None) – Specifies if the dag is paused when created for the first time. If the dag exists already, this flag will be ignored. If this optional parameter is not specified, the global config setting will be used.

so set is_paused_upon_creation=False

It's a function and you must call it with

dag.is_paused(False) 

you cannot access directly to the attribute because it's private, just use the funcion

Related