Search code examples
airflowdirected-acyclic-graphs

Airflow - retry_delay


Good afternoon,

I have a DAG runnin in Airflow. Right now, it has 1 re-try after 10 minutes. I would like to add a second retry after 12 hours. Is it possible to have multiple values as retry_delay? Thanks in advance!

 globals()[name] = dag = DAG(
        dag_id=name,
        tags=tags,
        default_args={
            'email_on_failure': True,
            'retries': 1,
            'retry_delay': timedelta(minutes=10) 
        },
        catchup=False,
        schedule_interval=schedule_interval,
        start_date=DEFAULT_START_DATE.replace(tzinfo=timezone),
    )

Solution

  • You can use retry_exponential_backoff that allow progressively longer waits between retries by using exponential backoff algorithm on retry delay (delay will be converted into seconds)