Skip to content
BENIBIX Learn

Airflow DAG

Data🗓️ OrchestrationApache Airflow

Also known as DAG File, Directed Acyclic Graph (Airflow)

One Airflow pipeline. It is a Python file with tasks, arrows and a time to run.

Think of it like

It is like a recipe card. It lists the steps, which ones come first, and when to cook.

Example

Jack's daily_sales DAG has four tasks. He opens the web page each morning and sees four green boxes.

Why it matters

The DAG is the unit you build, schedule, pause and rerun. Getting its shape right decides how fast and safe the pipeline is.

Definition

An Airflow DAG is one pipeline, written as a Python file. DAG stands for directed acyclic graph: tasks joined by one-way arrows, with no loops. The file names the tasks and the arrows between them. It also sets the schedule and the start date. Airflow reads the file and shows the graph on its web page.

Example code

python
from datetime import datetime
from airflow.sdk import dag, task
@dag(schedule="@daily", start_date=datetime(2026, 1, 1))
def daily_sales():
    @task
    def extract():
        return [1, 2, 3]
    @task
    def load(rows):
        print(len(rows), "rows")
    load(extract())
daily_sales()
A two-task DAG in Airflow 3. Passing extract into load is what draws the arrow between them.
This is a DAG. Every arrow points forward, and no path comes back to its start.

Common mistake

Using one giant DAG for everything. When one part breaks, the whole thing stops, and nobody can rerun just their piece.

Key takeaways

  1. 1
    One pipeline. A DAG is one workflow in one file.
  2. 2
    One-way arrows. Tasks point forward, never in a loop.
  3. 3
    Own schedule. Each DAG says when it runs.

Compare