A cron job that runs a script at 02:00 works until you have ten scripts that depend on each other. An orchestrator is the tool that runs tasks in the right order, notices failures and lets you see what happened.
The DAG
A workflow is described as a directed acyclic graph: tasks are nodes, dependencies are arrows, and there are no cycles. "Load orders" and "load customers" can run in parallel, "build sales table" waits for both, "refresh dashboard" waits for that.
# Pseudocode shape of a pipeline definition
tasks = {
"load_orders": [],
"load_customers": [],
"build_sales": ["load_orders", "load_customers"],
"refresh_dashboard": ["build_sales"],
}
def run_order(graph):
done, order = set(), []
while len(done) < len(graph):
for name, deps in graph.items():
if name not in done and all(d in done for d in deps):
order.append(name)
done.add(name)
return order
print(run_order(tasks))Features that matter
- Schedules with a logical date, so a run knows which time window it is processing.
- Retries with delays, for flaky networks and temporary outages.
- Backfills, to run a past range again after fixing a bug.
- Alerting and visibility: a clear view of which task failed, its log and its history.
- Concurrency limits, so ten backfill runs do not overwhelm a database.
- Sensors or triggers, to wait for a file or an upstream dataset.
Design habits
- Keep tasks small and idempotent, so retrying one is safe.
- Pass the run's logical date into tasks. Never read the wall clock inside them.
- Keep business logic in code you can test, and use the orchestrator only to wire things together.
- Do not pass large data between tasks. Pass references such as paths or table names.
Takeaway
An orchestrator is about reliability, not cleverness. Pick one your team can operate, model dependencies explicitly, and make every task safe to rerun.
Comments