# Airflow Schedules, Catchup and Retries Explained (With Code You Can Run)

> Understand Airflow schedule, catchup and retries with two small DAGs you can run free in Docker: why many runs start at once, and how a task retries.

Page: https://datautility.in/blog/airflow-schedule-catchup-retries-explained
This is the Markdown copy of the page. The tool itself runs in the browser: your files are processed on your own device and are not uploaded.

Published 2026-11-29 · Analyze & protect · airflow catchup, airflow schedule, airflow retries, airflow schedule interval explained, airflow retry_delay, airflow backfill vs catchup, airflow daily dag example

Short answer: `schedule` says how often a DAG runs, `catchup` says whether Airflow creates a run for every past interval since `start_date`, and `retries` says how many times a failed task is tried again. The fastest way to understand them is to run a small DAG and look at the runs, which you can do for free in the Airflow Lab.

Open the tool: [Airflow Lab](https://datautility.in/airflow-playground)

## Schedule

| Value | Runs |
|---|---|
| `None` | Only when you trigger it |
| `"@daily"` | Once a day |
| `"@hourly"` | Once an hour |
| `"0 6 * * *"` | A cron expression: every day at 06:00 |

## Catchup: why you get many runs at once

Say the `start_date` was three days ago and the DAG is daily. With `catchup=True`, Airflow creates one run for every day since the start date, so you see several runs the moment you turn the DAG on. With `catchup=False` only the latest interval runs.

```python
import pendulum
from airflow.sdk import DAG
from airflow.providers.standard.operators.bash import BashOperator

with DAG(
    dag_id="daily_schedule",
    start_date=pendulum.today("UTC").subtract(days=3),
    schedule="@daily",
    catchup=True,         # try False and see that only the latest day runs
    max_active_runs=1,
    tags=["lesson"],
) as dag:
    BashOperator(task_id="report", bash_command="echo 'Report for the day {{ ds }}'")
```

`{{ ds }}` is the date of the run. Each caught-up run prints its own day, so you can see which interval it covers. `max_active_runs=1` makes the runs go one at a time instead of all together.

### Which one should I use?

- Use `catchup=True` when each run processes one day of data and you want every missed day filled in, for example a daily load.

- Use `catchup=False` when only the newest run matters, for example a report that always shows the latest numbers.

- Set it on purpose. The default can surprise you with a pile of old runs.

## Retries

Some failures are temporary: an API times out, a database is busy. Retries let Airflow try again instead of failing the whole DAG.

```python
import pendulum
from datetime import timedelta
from airflow.sdk import dag, task, get_current_context


@dag(start_date=pendulum.datetime(2026, 1, 1, tz="UTC"), schedule=None, catchup=False,
     default_args={"retries": 2, "retry_delay": timedelta(seconds=3)})
def retries():
    @task
    def flaky_api_call():
        attempt = get_current_context()["ti"].try_number
        print(f"Attempt {attempt}")
        if attempt < 3:
            raise RuntimeError("The API did not answer, try again")
        print("Got the data on attempt", attempt)

    flaky_api_call()


retries()
```

The task fails on attempts 1 and 2 and succeeds on attempt 3. `retries=2` means two more tries after the first one, and `retry_delay` is the wait between them. For a flaky service, `retry_exponential_backoff=True` makes the wait grow after each failure.

### Retries are not a fix for bugs

A retry helps with temporary problems only. If the code is wrong it will fail every time, so keep retries low (two or three) and read the log of the first failure.

## Practise it

1. Start the [Airflow Lab](https://datautility.in/airflow-playground) and open lesson 4, Schedules and catchup.

2. Press **Trigger**, then open the DAGs tab and count the runs.

3. Change `catchup=True` to `False`, save, trigger again and compare.

4. Open lesson 5, Retries, press Test DAG and watch the three attempts in the output.

## How to use the Airflow Lab: step by step

1. Start the Airflow Lab
2. Open Schedules and catchup, trigger it and count the runs
3. Set catchup to False and trigger again
4. Open Retries and read the three attempts

## When to use the Airflow Lab

- Understanding why a DAG created many runs
- Choosing between catchup and no catchup
- Making a flaky task more reliable
- Explaining schedules and retries in an interview

## Example

Input:

```
a DAG that cleans data, runs a Spark job and lists the result
```

Output:

```
Task states in the lab, the DAG in the Airflow UI, the job in the Spark UI
```

## Frequently asked questions

### What does catchup do in Airflow?
With catchup=True, Airflow creates a DAG run for every schedule interval between the start date and now that has not run yet. With catchup=False it only runs the latest interval.

### Why does my new DAG start many runs at once?
Because catchup is on and the start date is in the past. Set catchup=False, or move the start date closer to today.

### How do I make an Airflow task retry?
Set retries and retry_delay on the task or in default_args, for example retries 2 and a delay of a few seconds. Airflow then tries the task again after a failure.

### What is the difference between catchup and backfill?
Catchup happens automatically when a DAG is turned on and has missed intervals. A backfill is a run you start yourself for a chosen date range.

Tip: Add {{ ds }} to a command and run a caught-up DAG. Seeing a different date on every run makes catchup click.

## Related tool pages

- [Learn Apache Airflow Free: Hands-On Airflow Lab](https://datautility.in/learn-airflow-free): Practise Apache Airflow hands-on, free: DAGs, dependencies, TaskFlow, schedules, retries, branching and mapping, with 11 lessons and the real Airflow UI on your laptop.

## Also try

- [Your first Airflow DAG](https://datautility.in/blog/airflow-first-dag-tutorial-taskflow-airflow-3)
- [Branching, mapping and task groups](https://datautility.in/blog/airflow-branching-dynamic-task-mapping-task-groups)
- [Airflow interview questions](https://datautility.in/blog/airflow-interview-questions-practice-hands-on)

## More guides

- [Data Profiler: Check Data Quality Before You Use It](https://datautility.in/blog/data-profiler-check-data-quality)
- [Compare Two CSV or Excel Files: Find Added, Removed and Changed Rows](https://datautility.in/blog/compare-two-csv-files-find-differences)
- [Data Masking: Hide Emails, Phones and Names Before Sharing](https://datautility.in/blog/data-masking-hide-emails-phones-pii)
