Catchup, backfill and end_date
When a pipeline is deployed with a start date in the past, or when old data must be reprocessed, Airflow can create runs for past dates. This lesson shows catchup, backfills, and how to run them without overloading anything.
Pipelines in production · Airflow · Bronze · Schedules, lesson 2 of 2
On this page
Read first: Schedules and logical dates (skip if you know it)
In plain words first
A cleaner who returns from two weeks off can clean only today, or clean every day they missed, one by one. Doing all fourteen at once would block the corridor.
catchup decides whether Airflow creates the missed runs when a DAGDAG: A pipeline in Airflow: a set of tasks and the order they run in, defined in a Python file and run on a schedule. Learn more → is deployed; a backfill is asking for past runs on purpose, at a controlled pace.
Deployed late: which runs exist?
A DAG with a start date in the past is deployed today. Should it run for every day it missed? catchup decides. In Airflow 3 it is False by default: the schedulerscheduler: The Airflow process that reads DAG files, creates runs when they are due, and queues the tasks whose upstream tasks are done. Learn more → creates a run for the most recent schedule that has passed, then one for every schedule after it. With catchup=True it creates a run for every schedule since start_date.
import pendulum from airflow.sdk import DAG from airflow.providers.standard.operators.bash import BashOperator with DAG( dag_id="royalties_daily", schedule="@daily", start_date=pendulum.datetime(2026, 3, 1, tz="UTC"), ): compute = BashOperator( task_id="compute_royalties", bash_command="royalties --day {{ ds }}" )
What the scheduler does · deployed Mar 5, 10:00 UTC · grid as of Mar 6, 01:00 UTC · @daily (CronTriggerTimetable)
| task \ run | Mar 5 00:00 | Mar 6 00:00 |
|---|---|---|
| compute_royalties |
success· the bar on top is the run's state; a number is how many tries
Catching up, one day at a time
Turn catchup on and the same deploy creates runs from 1 March. By default up to 16 runs of a DAG can be active at once (max_active_runs), so a long catch-up starts many runs together and every one of them hits the same warehouse. max_active_runs=1 makes them go in order: the next run is created when the previous one finishes. end_date stops the schedule.
import pendulum from airflow.sdk import DAG from airflow.providers.standard.operators.bash import BashOperator with DAG( dag_id="royalties_backfill", schedule="@daily", start_date=pendulum.datetime(2026, 3, 1, tz="UTC"), end_date=pendulum.datetime(2026, 3, 4, tz="UTC"), catchup=True, max_active_runs=1, ): compute = BashOperator( task_id="compute_royalties", bash_command="royalties --day {{ ds }}" )
What the scheduler does · deployed Mar 10, 08:00 UTC · grid as of Mar 10, 10:00 UTC · failing: compute_royalties in the 2026-03-02 run · @daily (CronTriggerTimetable)
| task \ run | Mar 1 00:00 | Mar 2 00:00 | Mar 3 00:00 | Mar 4 00:00 |
|---|---|---|---|---|
| compute_royalties |
successfailed· the bar on top is the run's state; a number is how many tries
The 2 March run fails, and the 3 March run starts anyway: runs are independent. When each day builds on the previous one (a running total, a snapshot table), set depends_on_past=True on the tasktask: One step of a DAG, such as running a query or calling an API. Each run of a task for one date is a task instance. Learn more →: it then waits until the same task succeeded in the previous run, so one bad day stops the days after it instead of producing wrong results on top of it.
Backfilling on purpose
Catchup is decided when the DAG is deployed. To reprocess a range later (a bug fix, a new column), run a backfill. In Airflow 3 the scheduler runs backfills, so they show up in the UI like any other runs and survive your terminal closing:
airflow backfill create --dag-id royalties_daily \ --from-date 2026-02-01 --to-date 2026-02-28 \ --reprocess-behavior failed \ --max-active-runs 2
| --reprocess-behavior | Days that already have a run |
|---|---|
| none | Left alone: only missing days are created |
| failed | Failed runs are run again |
| completed | Every day is run again, successful ones too |
A backfill only gives correct results if each run produces the same output whenever it runs, which is what Templates and idempotentidempotent: Safe to run again: running a step twice gives the same result as running it once. Learn more → reruns is about.
Common mistakes
- catchup=True on a DAG with a start date years ago — A daily DAG with
start_date2021-01-01 creates over 1,800 runs the moment it is deployed. Set a realisticstart_date, or backfill on purpose. - A long catch-up with the default max_active_runs — Up to 16 days start at once and hit the same warehouse together. Set
max_active_runsto 1 to 4. - Expecting a failed day to stop the next ones — 2 March fails and 3 March runs anyway, building its running total on a missing day. Set
depends_on_past=Trueon the task. - Backfilling a DAG whose tasks use the current date — A task that reads
datetime.now()processes today's data for every backfilled day of March. Use the run's date:{{ ds }}.
Key takeaways
- In Airflow 3, catchup defaults to False: a late deploy creates a run for the latest slot, then one for every slot after it.
- Catchup is decided at deploy; to reprocess a range later, use
airflow backfill create, which runs in the scheduler and shows in the UI. - A backfill's rerun option chooses what runs again: none (only missing days), failed, or completed (every day).
end_datestops the schedule, and a backfill is only correct if each run gives the same output whenever it runs.
Interview prep
THE QUESTION
"A DAG with start_date six months ago is deployed today. What runs does it create, and how would you load the six months?"
Avoid: "catchup is on by default". It was in Airflow 2; Airflow 3 defaults to catchup=False.
Follow-ups · answer out loud, then open
Follow-up"What does --reprocess-behavior do in airflow backfill create?"
Scenario"A backfill of a year must not overload the warehouse and must stop at the first bad day. How?"
Trap"depends_on_past makes the whole run wait for the previous run."
Check yourself
3 questionsA @daily DAG with start_date 1 March is deployed on 5 March at 10:00, catchup not set. Which runs are created that day?
Show the answer
Only 5 March. catchup defaults to False: the most recent slot that has passed, 5 March 00:00.
What does max_active_runs=1 do during a catch-up?
Show the answer
Runs the days one after another. The next run is created when the active one finishes.
Which option makes a task wait until it succeeded in the previous run?
Show the answer
depends_on_past. depends_on_past checks the same task in the previous run.
Practise this
Problems that use this, graded on hidden tests
- Backfill January, One Day at a TimeSchedules & catchup Medium
- Each Day Waits for YesterdayOrdering & concurrency Hard
- Your First Daily DAGSchedules & catchup Easy
Keep going
Up next · new module: Tasks · 5 min readOperators and TaskFlow
BashOperator, PythonOperator and @task: when to use which, and where providers come in.
Related lessons
Schedules and logical datesAirflow · 5 min read
Templates and idempotent rerunsAirflow · 5 min read
Retries, timeouts and callbacks
Previous: Schedules and logical dates