Airflow & DAGs · Core Concepts & DAGs

Operator vs Task vs Task Instance

Easyoperatortasktask-instance

Interview question

What is the difference between an Operator, a Task, and a Task Instance?

How to answer

Operator

A template/definition of what should happen.

Python
BashOperator(task_id="hello", bash_command="echo Hello")

Task

The Operator instantiated inside a becomes a task.

Output
Operator = blueprint
Task = configured task in the DAG

Task Instance

A particular execution of that task for a particular DAG run.

School analogy