Search code examples
restartairflow

How to restart a dag when it fails on airflow 1.8?


With:

default_args = {
    ...
    'retries': 1,
    'retry_delay': timedelta (seconds = 1),
    ...
} 

I can get the task that fails to retry several times, but how can I get it when a task fails, the DAG starts again?

Of course, automatically...


Solution

  • The canonical solution to this in Airflow is to create a subdagoperator that wraps all the other tasks in the dag, and apply the retry to that.