What You’ll Master Here
DAG and task are nouns you write. DAG run and task instance are nouns Airflow creates. You edit the first pair; you operate on the second pair.
Chapter 2 named the components. This chapter names the objects those components move around — and the reason it gets its own chapter is that four of them have similar names and are constantly used interchangeably by people who should know better.
Get this vocabulary precise and the rest of Airflow becomes readable. Leave it fuzzy and you will misdescribe your own bugs, which is the fastest way to get bad help.
DAG and task are nouns you write. DAG run and task instance are nouns Airflow creates. You edit the first pair; you operate on the second pair.
Almost every confusing Airflow conversation is a vocabulary problem in disguise. “The task failed” is ambiguous — a task is a definition and cannot fail; a task instance can. “I fixed the DAG” does not explain whether the fix applies to runs that already exist. Precision here saves entire debugging sessions.
- DAG
- The workflow definition — the graph of tasks you wrote. There is exactly one, no matter how long it has been running.
- DAG run
- One execution of that DAG for one data interval, with its own state and its own set of task instances.
- Task
- A node in the graph — also a definition. It describes work; it does not do work.
- Task instance
- One task, in one DAG run, on one attempt. The thing that actually has a state, a log and a duration.
Using “task” and “task instance” interchangeably. You end up saying things like “the task is stuck in queued”, which is not possible — definitions do not have states. The imprecision hides whether the problem is in the code you wrote or in one particular run.
Say “task instance” when you mean something with a state. It is a small habit that makes every incident description sharper.
When someone reports a failure, establish which run and which attempt before looking at anything.
Remember that editing the DAG file changes definitions only. Existing runs keep the shape they were created with.
This is the whole chapter in one line. A DAG is instantiated into a DAG run each time it runs, and the tasks under it are instantiated into task instances. Same relationship, one level down.
Two things you write, two things Airflow creates. Keeping them straight is not pedantry — it is how you describe a bug accurately.
