liveBook · Manning

Frequency-based schedule

As explained in Data Pipelines with Apache Airflow, Second Edition

A time-based schedule triggers workflow executions at predetermined times or regular temporal intervals.

A frequency-based schedule triggers an Airflow DAG at relative time intervals rather than matching a recurring calendar pattern. It handles cadences such as every two days, which cron expressions cannot represent reliably across month boundaries. section 3.3.4

Every two days

Define the schedule with a Pendulum duration: schedule=DeltaTriggerTimetable(pendulum.duration(days=2)). Starting on January 1, 2025, runs occur on January 3, 5, and so on. The same approach supports intervals such as 10 minutes or two hours. section 3.3.4

Configure the schedule with these operational choices:

  • Set start_date to establish when scheduling begins; supply a time zone there when UTC is not appropriate. section 3.3.4
  • Use end_date to stop scheduling and catchup to control whether past time points receive executions. section 3.8
  • Choose frequency-based scheduling for relative intervals; use cron expressions or Airflow shorthand when a calendar pattern is sufficient. section 3.3.4 section 3.8
Listing 3.7 Defining a frequency-based schedule
import pendulum
...

with DAG(
    dag_id="04_trigger_frequency",
    start_date=pendulum.datetime(year=2025, month=1, day=1),
    schedule=DeltaTriggerTimetable(pendulum.duration(days=2)),       #1
    ...
):
    ...

Inspect the compact DAG definition that applies a two-day Pendulum duration through DeltaTriggerTimetable. section 3.3.4

How Data Pipelines with Apache Airflow, Second Edition covers it

How deep it goes
Defines relative timing, implementation syntax, timezone handling, and operational controls, but does not detail scheduler internals.
Examples
Demonstrates two-day, ten-minute, and two-hour intervals through Pendulum durations and a DAG configuration.
What it assumes
Uses Airflow DAG scheduling, start_date, and Pendulum durations while distinguishing relative frequencies from cron patterns.
What you can do after
Operate/configure Airflow DAGs with relative intervals, timezone-aware start dates, and optional historical catchup.
How it connects
Connects frequency schedules with cron expressions, start_date, end_date, catchup, time zones, and data intervals.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Pipelines with Apache Airflow, Second Edition. The section links point to the parts of the book it draws on.