What an Orchestrator Should and Should Not Do
What a workflow orchestrator such as Airflow 3 or Dagster is for: dependencies, schedules and data intervals, state, retries and alerts. What it should hand to other systems: heavy compute and the data itself. A first look at task-centric and asset-centric tools, and at the pieces you run locally.
Contentsand lesson path
On this page
- Why it matters
- A pipeline is a graph of declared dependencies
- Schedules, data intervals and state
- What an orchestrator should not do
- Tasks or assets, and how you run one locally
- Check your understanding
- Apply it
- Review prompt
Lessons of Data Pipeline Orchestration
- What an Orchestrator Should and Should Not Do Concept · 20 min
- Lab: A First Airflow 3 DAG with the TaskFlow API Lab · 30 min
- Logical Dates, Partitions and Backfills Worked example · 25 min
- Lab: Retries, Sensors, Assets and Alerts Lab · 25 min
- The Asset-Centric Alternative: Dagster Worked example · 20 min
- Check: Orchestration Failure Scenarios Knowledge check · 8 questions
What you will learn
- Model a pipeline as a DAG of tasks or data assets with explicit dependencies, schedules and data intervals.
- Compare task-centric and asset-centric orchestration (Airflow and Dagster as examples) and run an orchestrator locally with containers.
Prerequisites: ETL/ELT Pipeline Design
01. Why it matters
Most pipelines start as a script and a cron entry: at 01:00, run load.py. That works until the pipeline has five steps, one of which waits for a partner file and one of which fails about once a week, and a new report needs the last six months rebuilt. Cron can start a command at a time. It cannot tell you which of last night's steps failed, run only the steps after the failure, or run the job once for each of 180 past days with the right date each time.
A workflow orchestrator is the system that does this coordination. It knows the steps of a pipeline and the order between them, decides when each run should start and which slice of time it covers, records the state of every attempt, retries what failed and tells a person when retrying is not enough. Apache Airflow (3.4 in this skill) and Dagster are two widely used open-source orchestrators. This lesson explains what they do, what they should leave to other systems, and the two styles they represent.
02. A pipeline is a graph of declared dependencies
An orchestrator models a pipeline as a DAG, a directed acyclic graph. Each node is a task, one unit of work such as "extract the orders". Each edge says that one task must finish successfully before another may start; the earlier task is upstream, the later one downstream. "Acyclic" means you cannot follow the edges back to where you started, so there is always an order in which every task can run.
The important word is declared. The orchestrator does not read your code to guess that transform uses the file extract wrote. It only knows the edges you state. By default, any task whose upstream tasks have all succeeded is ready to run, possibly at the same time as other ready tasks. The script below uses Python's standard graphlib module to show this. Each "wave" is the set of tasks that are ready together.
"""Which tasks may run at the same time? Only the declared edges decide."""
from graphlib import TopologicalSorter
def show_waves(name, graph):
"""Print the tasks that are ready together, wave by wave."""
sorter = TopologicalSorter(graph)
sorter.prepare()
print(name)
wave = 1
while sorter.is_active():
ready = sorted(sorter.get_ready())
print(f" wave {wave}: {', '.join(ready)}")
sorter.done(*ready)
wave += 1
# task -> the set of tasks it waits for (its upstream tasks)
declared = {
"extract_orders": set(),
"extract_customers": set(),
"transform": {"extract_orders", "extract_customers"},
"load": {"transform"},
"notify": {"load"},
}
forgotten = {"extract": set(), "transform": set(), "load": set()}
show_waves("with dependencies", declared)
show_waves("without dependencies", forgotten)python3 dependencies.pywith dependencies
wave 1: extract_customers, extract_orders
wave 2: transform
wave 3: load
wave 4: notify
without dependencies
wave 1: extract, load, transformThe two extracts have no upstream tasks, so they start together, and transform waits for both: this shape is called a fan-in. In the second graph nobody declared an edge, so all three tasks are ready at once, even though the names suggest an order. A real orchestrator behaves the same way, so a missing edge shows up as a task reading a file that does not exist yet. If an upstream task fails for the last time, the orchestrator does not start its downstream tasks; Airflow marks them upstream_failed. When you rerun the failed task together with its downstream tasks (Airflow calls this clearing them), they continue from there.
03. Schedules, data intervals and state
A schedule says when runs happen. For data pipelines the more useful idea is the data interval: the window of time a run is responsible for. A daily run labelled 2 November covers the orders from 2 November 00:00 up to, but not including, 3 November 00:00. That window is only complete after midnight, so the run starts after its interval ends. In Airflow the label of a run is its logical date; with an interval timetable it is the start of the window, not the moment the run happens. The script prints the first three daily intervals.
"""Daily data intervals: each run owns one closed window of time."""
from datetime import datetime, timedelta, timezone
start = datetime(2026, 11, 1, tzinfo=timezone.utc)
for n in range(3):
begin = start + timedelta(days=n)
end = begin + timedelta(days=1)
print(f"run {begin:%Y-%m-%d}: covers {begin:%d %b %H:%M} to {end:%d %b %H:%M}, "
f"can start after {end:%d %b %H:%M} UTC")run 2026-11-01: covers 01 Nov 00:00 to 02 Nov 00:00, can start after 02 Nov 00:00 UTC
run 2026-11-02: covers 02 Nov 00:00 to 03 Nov 00:00, can start after 03 Nov 00:00 UTC
run 2026-11-03: covers 03 Nov 00:00 to 04 Nov 00:00, can start after 04 Nov 00:00 UTCBecause each run owns a fixed window, its result does not depend on when it happens to run. A run delayed by an outage, retried at 09:00 or rebuilt next year gives the same answer, as long as its tasks read the window from the run instead of from the clock. That is what makes backfills possible: runs created for a range of past intervals, one per interval.
Around this, the orchestrator keeps state in a metadata database: every run, every task attempt, its start and end, its logs and its outcome. From that state it can retry a failed attempt after a delay, give up after a limit, stop an attempt that runs too long, skip work that is already done, and call a failure callback that alerts a person. Lessons 2 to 4 of this skill configure each of these in Airflow 3 and watch them happen.
04. What an orchestrator should not do
An orchestrator coordinates work; it is a poor place to do heavy work or to keep data. Three habits cause most trouble.
- Heavy compute inside the orchestrator's workers. A join over hundreds of gigabytes belongs in a warehouse, Spark or dbt. The orchestrator's task should submit the job, wait for it and record the result. A task that loads a large table into a worker's memory competes with every other task on that worker.
- Using the orchestrator as storage. Tasks write their outputs to a database, a warehouse or object storage. The orchestrator stores only metadata about runs.
- Passing datasets between tasks. Airflow passes small values between tasks through XCom ("cross-communication"), and by default XComs are rows in the metadata database. The documentation says they are designed for small amounts of data and not for values such as dataframes. Pass a path, a table name, a row count or an ID.
The next script shows the size difference for one day of 200,000 orders.
"""What should one task hand to the next: the rows, or where they are?"""
import json
import random
rng = random.Random(7)
rows = [{"order_id": i, "customer": rng.randint(1, 5000),
"amount": round(rng.uniform(5, 300), 2)} for i in range(200_000)]
as_data = json.dumps(rows)
as_reference = json.dumps({"path": "s3://lake/raw/orders/day=2026-11-02/",
"rows": len(rows)})
print(f"pass the rows: {len(as_data) / 1_000_000:.1f} MB")
print(f"pass a reference: {len(as_reference)} bytes")pass the rows: 11.4 MB
pass a reference: 64 bytesEleven megabytes per run, for every run and every retry, would grow the metadata database that the scheduler reads constantly, and the components that read it could slow down with it. The 64-byte reference tells the next task where to read the data, and the data stays in storage built for it. In the same spirit, a task function should be a thin wrapper around a function or query that you can test on its own.
05. Tasks or assets, and how you run one locally
Orchestrators describe the graph in one of two styles. In a task-centric tool, such as a classic Airflow DAG, the nodes are actions: "run extract, then transform". The data each action produces is implicit; the tool knows that transform succeeded, not which table it changed. In an asset-centric tool, such as Dagster, the nodes are the data products themselves, called assets: the raw_orders files, the region_revenue table. You declare which assets each asset is built from, and the tool can show lineage (what feeds what), which partitions exist and which assets are out of date. Airflow 3 also has assets, which tasks declare as outputs and which can trigger other DAGs, and Dagster also runs plain jobs, so the difference is what the model puts first. Task-centric fits workflows made of side effects, such as sending emails or restarting services; asset-centric fits pipelines whose main output is tables. Lesson 5 builds the same pipeline in Dagster so you can compare.
To run Airflow 3 you need several cooperating processes. The scheduler decides what should run and hands tasks to an executor. The DAG processor parses your DAG files and stores them in the metadata database (PostgreSQL in these labs). The API server serves the web UI and the REST API, and tasks use it to report their state. The triggerer runs deferred waits, which lesson 4 uses. For development, airflow standalone starts all of them in one terminal.
The official Docker Compose quick start starts these components as containers from the apache/airflow image, plus PostgreSQL and Redis for the Celery executor; the documentation asks for at least 4 GB of memory for Docker and says the file is for learning, not production. The labs here take a lighter route: Airflow installed from PyPI with the official constraints file, against PostgreSQL in a container. Either way, running the same versions and services as production on your laptop finds missing packages, wrong connection settings and parse errors before a deployment does, and gives you a disposable metadata database. The skill practice asks you to try the Compose version too; the Apply it section of the first lab lists its steps.
06. Check your understanding
07. Apply it
The practice for this skill is a daily ingest, transform and test pipeline with a 14-day backfill, a retry that ends in an alert, and a downstream run triggered by an updated asset. Before you write any code, sketch it on paper:
- the tasks and the edges between them, with any fan-in or fan-out;
- the data interval of one run, and the partition each task writes for that interval;
- what each task passes to the next (a path, a table name, a count), and where the data itself lives;
- which steps call slow or flaky systems and so need retries and a timeout.
Keep the sketch. In the first Airflow lab you turn the first three points into a DAG.
08. Review prompt
Without looking back, explain: why tasks with no declared edges may run at the same time; what a data interval is and why a daily run starts after its interval ends; three things the orchestrator records about each attempt; why XCom should carry a path rather than a dataframe; and one kind of workflow where a task-centric model fits better than an asset-centric one.
References
Your progress
Reading state
Sign in to save that you finished reading this lesson.
Prove this skill
8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.