Skip to content
Bronze 5 min read · Basics

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

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

Runs a pipeline at fixed times (every day at 02:00) or when data arrives, and remembers which runs exist.

Dependencies

Runs a step only when the steps it depends on have finished the way it needs.

Failures

Retries a step, alerts someone, and runs clean-up even when something failed.

History

Keeps every run and every attempt with its logs, so you can see what ran, when, and rerun a past day.

Why not cron?

NeedcronAirflow
Run B only after A succeededGuess a later time for B, or chain scriptsDependencies are part of the pipeline
A step fails at 03:00Nothing happens until someone noticesRetries, then marks it failed and alerts
Rerun last TuesdayEdit dates in the script by handClear that run; it reruns with Tuesday's dates
See what ran and how long it tookGrep the logs on one machineA UI with every run, attempt and log
Fill a month that was missedA loop in a shell scriptCatchupcatchup: 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

ComponentJob
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 → processorReads your DAG files over and over and stores what they define
SchedulerDecides 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
TriggererWaits 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 serverServes 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?"

Cron starts a command at a time. Airflow models the whole pipeline: dependencies between steps, retries and alerts when a step fails, a record of every run and attempt, reruns of any past day with that day's dates, and catchup or backfill of missed periods. It also separates scheduling from execution: the scheduler decides, executors run tasks on workers, so pipelines scale beyond one machine. I would add that Airflow orchestrates; the processing happens in Spark, the warehouse or dbt.

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?"
The scheduler decides which runs exist and which task instances are ready, based on schedules, dependencies and trigger rules, and hands ready tasks to the executor. Workers (local processes, Celery workers or Kubernetes pods, depending on the executor) actually run the task code. In Airflow 3 the DAG processor parses files separately, and tasks report back through the API server.
Scenario"A team wants Airflow to process clickstream events within a second of arrival. Your advice?"
Not Airflow: each run has scheduling overhead of seconds, and it is built for batches. Use a streaming job (Kafka with Spark Structured Streaming or similar) for the per-event processing, and use Airflow for what surrounds it: deploying, compacting tables, daily aggregates and backfills.
Trap"In Airflow 3, a task can query the metadata database to read another DAG's state."
Not directly: Airflow 3 runs tasks through the Task SDK and the Execution API, with no database connection from task code. Use the provided APIs (XCom, the context, sensors such as ExternalTaskSensor, or asset events) instead.

Check yourself

3 questions

Which 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 read
A DAG file, line by line
The DAG, its tasks and dependencies, and why the file runs every time it is parsed.

Related lessons

Primary sources: Airflow overview · Upgrading to Airflow 3