Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. Operator vs Task vs Task Instance

Airflow & DAGs · Core Concepts & DAGs

Operator vs Task vs Task Instance

Easyairflow-04
operatortasktask-instance

Question

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

Solution

Operator

A template/definition of what should happen.

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

Task

The Operator instantiated inside a DAG becomes a task.

Operator = blueprint
Task = configured task in the DAG

Task Instance

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

Task: load_sales
Sep 1 → Task Instance
Sep 2 → Task Instance
Sep 3 → Task Instance

School analogy

Operator      → Exam template
Task          → Mathematics exam
Task Instance → Raja's Mathematics exam on September 5
PreviousNext