What Airflow is (and is not)
Every data team has jobs that must run in order, on a schedule, and be retried when they fail. Airflow is the most common tool for that. This lesson explains what an orchestrator does, why cron is not enough, and what Airflow does and does not do.
Pipelines in production · Airflow · Bronze · Orchestration basics, lesson 1 of 3
On this page
In plain words first
Think of a film director. The director does not act, film or edit, but decides who does what and in which order, calls "again" when a take goes wrong, and keeps a record of every take.
Airflow is the director of your pipelines: it starts each step at the right time, in the right order, retries failures and records every attempt. The actual work happens in Spark, a warehouse or dbt.
An orchestrator runs other people's work
A data pipeline is a set of steps with an order: load yesterday's plays, then aggregate them, then publish the charts, every night. Airflow is the system that decides when each step runs, runs them in the right order, retries the ones that fail, records every attempt, and lets you rerun any day of history. It does not process the data itself. The steps call Spark, a warehouse, dbt or an API; Airflow coordinates them.
Schedules
Dependencies
Failures
History
Why not cron?
| Need | cron | Airflow |
|---|---|---|
| Run B only after A succeeded | Guess a later time for B, or chain scripts | Dependencies are part of the pipeline |
| A step fails at 03:00 | Nothing happens until someone notices | Retries, then marks it failed and alerts |
| Rerun last Tuesday | Edit dates in the script by hand | Clear that run; it reruns with Tuesday's dates |
| See what ran and how long it took | Grep the logs on one machine | A UI with every run, attempt and log |
| Fill a month that was missed | A loop in a shell script | Catchupcatchup: Whether Airflow creates runs for every past period between start_date and now when a DAG is switched on. Learn more → or a backfillbackfill: Running a DAG for past dates on purpose, to fill in or redo history. Learn more →, run by the schedulerscheduler: The Airflow process that reads DAG files, creates runs when they are due, and queues the tasks whose upstream tasks are done. Learn more → |
What an Airflow 3 deployment is made of
| Component | Job |
|---|---|
| DAGDAG: A pipeline in Airflow: a set of tasks and the order they run in, defined in a Python file and run on a schedule. Learn more → processor | Reads your DAG files over and over and stores what they define |
| Scheduler | Decides which runs and taskstask: One step of a DAG, such as running a query or calling an API. Each run of a task for one date is a task instance. Learn more → are due and hands tasks to the executorexecutor: The part of Airflow that decides where queued tasks run: in local processes, on Celery workers or as Kubernetes pods. Learn more → |
| Executor and workersworker: The process that actually runs a task instance, on whatever machine the executor sends it to. Learn more → | Run the tasks: in local processes, on Celery workers, or as Kubernetes pods |
| Triggerer | Waits on behalf of deferreddeferrable: A task that hands its waiting over to the triggerer process and frees its worker slot until the event it waits for happens. Learn more → tasks (sensorssensor: A task that waits until something is true, such as a file arriving, before downstream tasks may run. Learn more → that do not hold a worker) |
| API server | Serves the UI and the REST API, and the Execution API that running tasks talk to |
| Metadata databasemetadata database: The database where Airflow records every DAG run, task instance, state and setting. Learn more → | Holds runs, task states, XComsXCom: Cross-communication: small values one task saves for later tasks to read, like a file path or a row count. Not for the data itself. Learn more → and connections |
In Airflow 3, tasks no longer connect to the metadata database directly: they talk to the API server through the Task SDK. That is why the imports you write are from airflow.sdk import ..., and why task code cannot reach into Airflow's internals the way Airflow 2 code sometimes did.
When Airflow is the wrong tool
- Processing events one by one, in seconds: that is a streaming job (Kafka, Spark Structured Streaming). Airflow can start and watch it, not replace it.
- Moving large data through Python tasks: tasks should tell Spark or the warehouse what to do, not hold the data themselves.
- Pipelines that must run every few seconds: each run has scheduling overhead measured in seconds.
Common mistakes
- Doing the heavy processing inside Python tasks — Workers are not a compute cluster. Push the work to Spark or the warehouse.
- Using Airflow as a streaming engine — Runs every few seconds pile up overhead. Use a streaming job and let Airflow manage it.
- Chaining scripts with cron and sleep — Order, retries and history all have to be rebuilt by hand.
Key takeaways
- Airflow decides when and in what order steps run, retries them, and records everything.
- It orchestrates other systems; it is not where data is processed.
- Airflow 3: DAG processor, scheduler, executor and workers, triggerer, API server, metadata database.
- Tasks talk to Airflow through the Task SDK, not the database.
Interview prep
THE QUESTION
"What does Airflow do that a cron job does not?"
Avoid: "Airflow is an ETL tool". It moves no data itself; it schedules and coordinates the systems that do.
Follow-ups · answer out loud, then open
Follow-up"What does the scheduler do, and what do the workers do?"
Scenario"A team wants Airflow to process clickstream events within a second of arrival. Your advice?"
Trap"In Airflow 3, a task can query the metadata database to read another DAG's state."
Check yourself
3 questionsWhich of these is Airflow's job?
Show the answer
Running the aggregation after the load succeeds, and retrying it if it fails. It orchestrates; the aggregation itself runs in Spark or the warehouse.
Which component turns DAG files into what the scheduler sees?
Show the answer
The DAG processor. It parses the files and stores the DAGs they define.
How does a task reach Airflow's metadata in Airflow 3?
Show the answer
Through the API server, via the Task SDK. Airflow 3 moved task execution behind the Execution API.
Keep going
Up next · Orchestration basics · lesson 2 of 3 · 5 min readA DAG file, line by line
The DAG, its tasks and dependencies, and why the file runs every time it is parsed.
Related lessons
Running Airflow 3 on your laptopStructured Streaming · 8 min read
Structured Streaming basics
Primary sources: Airflow overview · Upgrading to Airflow 3