On the night from Sunday to Monday, Bookshop's MySQL extract runs late, until 01:30. sales still runs at 01:00 as cron says, weekly_best_sellers at 02:00, and at 06:00 the owner reads a report that arrived on time but is one book short, with no error and no alarm. The single Airflow DAG from the earlier lesson is only the start. Orchestration at scale is running many pipelines owned by many teams that depend on one another, in the right order, on the right data, and knowing when something is stuck. It's like an airport. Many airlines, many planes, one control tower. The connecting flight waits for transit passengers whose first flight landed late; it does not leave just because the clock says so, abandoning half its passengers. When a plane is held too long, the airport board shows DELAYED so everyone knows. The control tower is the orchestrator, departure times are cron, "leave after the transit flight lands" is data-aware scheduling, and the DELAYED board is an alert.
From one DAG to many teams
In the Airflow lesson, one DAG did everything. As teams grow, pipelines split up, and what connects them are assets: tables or files one pipeline produces and another reads. Bookshop's small asset graph in the Lab:
| Asset | Owner | Read by |
|---|---|---|
raw_order_lines |
data team, MySQL extract at 00:05 | sales |
sales |
data team, one partition per day | weekly_best_sellers, customer_segments |
weekly_best_sellers |
data team | the shop owner, Monday 06:00 |
customer_segments |
marketing team | email campaigns |
customer_segments belongs to another team, in another repo, with its own schedule. The question: when may it run?
Cron or data-aware
There are two ways to trigger sales:
- Cron: runs at a fixed time, say 01:00, whether its upstream is ready or not.
- Data-aware (asset-based): runs as soon as its upstream is updated.
On the night of Sunday 4 to Monday 5 October, the MySQL replica lags and raw_order_lines only finishes at 01:30. The 4 October partition holds Maya's order 8 (1 The Rainbow Troops). The Lab's result, run in SQLite:
| Scheduling | sales[2026-10-04] |
weekly_best_sellers ready |
Week of 28 September |
|---|---|---|---|
| cron 01:00 | runs 01:00, 0 rows | 02:00 | 12 books, the "Unknown" row is missing |
| data-aware | runs 01:31, 1 row | 01:33 | 13 books, complete |
With cron, the report is short and arrives on time, with no error and no alarm, just as at the start of this lesson. Data-aware is a little later but right, and the marketing team waits for complete data too.
In Airflow 3, asset-based scheduling is written with Asset. This code is parsed by Airflow 3.3.2 with no import errors:
import pendulum
from airflow.sdk import Asset, dag, task
LONDON = "Europe/London"
raw_order_lines = Asset("raw_order_lines")
sales = Asset("sales")
@dag(schedule="5 0 * * *", start_date=pendulum.datetime(2026, 9, 28, tz=LONDON), catchup=False)
def extract_mysql():
@task(outlets=[raw_order_lines])
def load_raw() -> None:
... # copy yesterday's orders from the MySQL replica
load_raw()
@dag(schedule=[raw_order_lines], start_date=pendulum.datetime(2026, 9, 28, tz=LONDON), catchup=False)
def build_sales():
@task(outlets=[sales])
def load_sales() -> None:
... # DELETE then INSERT one date
load_sales()
extract_mysql()
build_sales()
outlets=[raw_order_lines]: this task updates that asset. When the task succeeds, Airflow records an asset event.schedule=[raw_order_lines]: the DAG runs on every event for that asset, not at a set time. The marketing team'scustomer_segmentsDAG just writesschedule=[sales].
In Dagster (1.13.26), assets are the centre: each @dg.asset function produces one table, and automation_condition says when it is rebuilt. Part of the code that ran on a laptop with DuckDB:
daily = dg.DailyPartitionsDefinition(start_date="2026-09-28", timezone="Europe/London")
@dg.asset(partitions_def=daily)
def sales(context: dg.AssetExecutionContext) -> dg.MaterializeResult:
order_date = context.partition_key # e.g. "2026-10-04"
... # DELETE then INSERT one date
return dg.MaterializeResult(metadata={"row_count": row_count})
@dg.asset(
deps=[sales],
automation_condition=dg.AutomationCondition.eager(),
freshness_policy=dg.FreshnessPolicy.time_window(fail_window=timedelta(hours=30)),
owners=["team:data"],
)
def weekly_best_sellers() -> dg.MaterializeResult: ...
AutomationCondition.eager() means "rebuild as soon as upstream changes". In Prefect (3.8.8), the pipeline is plain Python functions with @flow and @task(retries=2, retry_delay_seconds=300); a deployment is scheduled by cron or triggered by events through an automation.
Sensors or events
Sometimes what you wait for is not an asset in the same orchestrator, such as the marketplace's stock file in an SFTP folder.
- A sensor checks now and then. Starting at 00:00, every 5 minutes, the file arrives at 03:00: 37 checks, 36 wasted. A poke-mode sensor holds a worker slot while it waits; a deferrable sensor (Airflow) hands its slot to the triggerer between checks.
- An event: the source sends a message when it is ready, and the pipeline reacts once. Airflow 3 can trigger a DAG from a queue message through an
AssetWatcher; Prefect through an automation; Dagster through a sensor that reads the queue.
Use an event when the source can announce itself, a sensor when it cannot.
SLA, freshness and alerts
The owner reads weekly_best_sellers on Monday at 06:00. The promise "the report is ready before 06:00" is an SLA (service level agreement), and freshness is how recent the data is. Two alarms are needed:
- A failure alarm: a task that still fails after its retries (3 attempts, 5 minutes apart) sends a notification to chat or email.
- A freshness alarm: at 06:00, check whether
weekly_best_sellerswas updated tonight. If the extract fails and scheduling is data-aware, the assets downstream do not run, and this check fires:ALERT weekly_best_sellers not updated tonight (deadline 06:00). The owner knows the report is not there, instead of reading wrong numbers.
In Airflow 3 the old SLA feature was removed and replaced by Deadline Alerts. Dagster has the FreshnessPolicy in the code above (fail when not updated for more than 30 hours). dbt has source freshness from the dbt lesson. Careful: a freshness check does not know whether the content is right. With cron on that late night, the check says OK, because the report was indeed updated at 02:00. Data quality tests (the data quality lesson) catch the content.
Big backfills and idempotency
A backfill reruns an asset for past dates, for example after a transform rule is fixed. A backfill of sales from 28 September to 4 October with Dagster 1.13.26, one partition per run, then weekly_best_sellers:
for order_date in ["2026-09-28", "2026-09-29", "2026-09-30", "2026-10-01", "2026-10-02", "2026-10-03", "2026-10-04"]:
result = dg.materialize([sales], partition_key=order_date)
meta = result.asset_materializations_for_node("sales")[0].metadata
print(order_date, result.success, meta["row_count"].value)
result = dg.materialize([weekly_best_sellers]) # its metadata: books in the week of 28 September
print("weekly_best_sellers", result.success, result.asset_materializations_for_node("weekly_best_sellers")[0].metadata["books_week_28_sep"].value)
2026-09-28 True 3
2026-09-29 True 1
2026-09-30 True 2
2026-10-01 True 2
2026-10-02 True 1
2026-10-03 True 0
2026-10-04 True 1
weekly_best_sellers True 13
A backfill is safe only when each partition is idempotent, as in the ETL lesson: DELETE that date first, then INSERT. With INSERT alone, every partition that was already filled doubles, and that week becomes 26 books. At scale, time counts too. A year = 365 partitions; at 2 minutes each with at most 4 at once: 92 waves, 184 minutes. The parallel limit is on purpose, so the MySQL replica is not flooded with 365 queries at once.
Cost
The orchestrator itself runs 24 hours: scheduler, workers, metadata database, and for Airflow also the triggerer and API server. A poke sensor that waits long eats a worker slot. A backfill pays warehouse compute for every partition. Managed services move the servers to a vendor, for a monthly price: Astronomer, Google Cloud Composer and Amazon MWAA for Airflow; Dagster+ for Dagster; Prefect Cloud for Prefect. For Bookshop, cron plus the one DAG from the Airflow lesson is still enough; orchestration at scale starts to matter when several teams have dozens of pipelines that depend on each other.
Airflow, Dagster, Prefect
All three are open source (Apache 2.0) and written in Python. Versions as of October 2026: Airflow 3.3.2 (17 September 2026), Dagster 1.13.26 (9 October 2026), Prefect 3.8.8 (6 October 2026).
| Airflow | Dagster | Prefect | |
|---|---|---|---|
| Main unit | DAGs and tasks | assets (tables or files) | flows and tasks (Python functions) |
| Data-aware | assets since 3.0 (datasets since 2.4) | the core of its design, with partitions and backfills | event triggers through automations |
| Try it on a laptop | airflow dags test |
dg.materialize(...) |
call the flow function directly |
| Typical strength | the largest ecosystem of operators and providers | asset lineage, dbt integration | dynamic Python pipelines |
Prefect and Dagster were born after Airflow, with a native Python API, data-aware scheduling and a developer experience designed in from the start; that is the difference most often cited. Airflow caught up: the TaskFlow API in 2.0, datasets in 2.4, assets and the airflow.sdk imports in 3.0. A team that already has hundreds of Airflow DAGs usually gains most by staying; a team that thinks in dbt tables often fits Dagster; a team with many Python scripts that needs retries and triggers quickly often fits Prefect. Choose from your team's needs, not from which sounds newest.
⚠️ Cron, backfills, alarms and sensors used the wrong way
- Cron for cross-team dependencies. "The data team usually finishes at 01:00" is a guess. A late night gives a report that is on time but wrong. Use assets.
- Backfills without idempotency.
INSERTalone doubles every partition it reruns.DELETEthenINSERTper date, in one transaction. - Alerts for everything. An alarm that rings every day ends up ignored. Ring for what needs action: failure after retries, and the freshness deadline promised to users.
- Hours-long poke sensors. Every waiting sensor holds a worker slot. Use deferrable sensors, longer intervals, or events.
TL;DR: Orchestration at scale connects many teams' pipelines through assets: raw_order_lines, sales, weekly_best_sellers, and the marketing team's customer_segments. Cron runs at a fixed time; data-aware runs when the upstream updates. When the extract runs late until 01:30, cron makes the report on time but short (12 books), data-aware makes it at 01:33 and complete (13). Airflow 3 writes it as outlets=[Asset(...)] and schedule=[Asset(...)], Dagster with @dg.asset and AutomationCondition.eager(), Prefect with deployments and automations. A sensor checks periodically (37 checks to wait 3 hours), an event triggers once. Set a failure alarm and a freshness check (Deadline Alerts in Airflow 3, FreshnessPolicy in Dagster), and remember a freshness check does not judge content. A backfill is safe only with idempotent partitions (INSERT alone: 26 books, not 13), and is limited in parallelism. Airflow 3.3.2, Dagster 1.13.26 and Prefect 3.8.8 are chosen by a team's needs, not ranked.
⚡ Cron or data-aware
Guess first: the MySQL extract runs late, until 01:30, but sales runs on a 01:00 cron. How many books does the report show for the week of 28 September?
It shows 12, where the truth is 13. The "Unknown" row is missing, with no error and no alarm. Data-aware, sales only runs at 01:31 and the result is complete.
Meaning: Cron runs at a fixed time, whether its upstream is ready or not. Data-aware runs as soon as its upstream is updated.
⚡ Assets in Airflow 3
Write:
@dag(schedule=[raw_order_lines], start_date=pendulum.datetime(2026, 9, 28, tz=LONDON), catchup=False)
def build_sales():
@task(outlets=[sales])
def load_sales() -> None:
... # DELETE then INSERT one date
Meaning: schedule=[raw_order_lines] makes the DAG run on every event for that asset. outlets=[sales] records a new event when the task succeeds, so the marketing team just writes schedule=[sales].
⚡ A freshness alarm
Meaning: At 06:00, check whether weekly_best_sellers was updated tonight. If not, the owner knows the report isn't there, instead of reading wrong numbers. But freshness doesn't know whether the content is right: that's what data quality tests are for.
⚡ A safe backfill
Meaning: A backfill is safe only when each partition is idempotent: DELETE that date first, then INSERT. The parallel limit is there on purpose too, so the MySQL replica isn't flooded with 365 queries at once.