Skip to main content

Airflow Scheduling Mastery

Module Level: Core Foundation Prerequisites: Modules 1-3 (Overview, Core Concepts, Operators) Duration: 3-4 hours Key Concepts: Cron, execution dates, catchup, backfill, SLAs, trigger rules

Understanding Airflow’s Scheduling Model

Airflow’s scheduling is based on a crucial concept: DAGs run at the END of the data interval, not at the beginning.

The Data Interval Concept

Schedule Interval Formats

Cron Expressions

Testing Cron Expressions

Catchup and Backfill

Catchup Behavior

Manual Backfill via CLI

Depends on Past

Control whether tasks wait for previous runs to complete.

SLAs (Service Level Agreements)

Define expected task completion times and get alerted on breaches.

DAG Run States and Timeouts

Timetables (Airflow 2.2+)

Advanced scheduling beyond cron and timedelta.

Best Practices

Summary

You now understand:
  • Scheduling Model: execution_date vs actual run time
  • Cron Expressions: All common patterns and custom schedules
  • Catchup & Backfill: When to use and how to control
  • SLAs: Setting expectations and alerting on breaches
  • Timeouts: Task and DAG-level execution limits
  • Concurrency: Controlling parallel execution
  • Best Practices: Production-ready scheduling configuration
Key Takeaways:
  1. execution_date is the start of the data interval, not when the DAG runs
  2. Use catchup=False unless you need automatic backfilling
  3. Set SLAs for critical pipelines to catch slowdowns early
  4. Make tasks idempotent so they can be safely retried/backfilled
  5. Use pools to limit resource consumption
  6. Set timeouts to prevent hung tasks from blocking pipelines

Next Steps

Module 5: Sensors and Hooks - Waiting and Connecting

Master sensors for waiting, hooks for connections, and custom implementations