# Airflow Task Group

> A box that holds related Airflow tasks. Big DAGs get easier to read.

**Field:** Data Engineering  
**Category:** Orchestration  
**Also known as:** TaskGroup, Task Group, @task_group

## Think of it like

It is like a folder on a desk. Ten loose sheets become one neat folder you can open.

## Definition

A task group puts related Airflow tasks in one box in the graph view. The box can be closed, so a big DAG is easier to read. The tasks still belong to the same DAG and follow its settings. A group can also set its own defaults, such as the number of retries. Each task's name starts with the group's name, so names stay clear.

## Example

A DAG loads twelve regions. Jack puts the twelve load tasks in a group called load_regions. The graph now shows one box he can open.

## Example code

```python
from airflow.sdk import task_group

@task_group
def load_regions():
    load_europe()
    load_asia()
```

Two load tasks inside one group. In the graph they show as one box.

## Why it matters

Big DAGs turn into a wall of boxes. Groups bring back the shape a person can follow.

## Common mistake

Thinking a group is a separate DAG. Its tasks still run inside the same DAG, with the same settings.

## Three principles

- **Tidy view.** Many tasks show as one box.
- **Same DAG.** Not a separate pipeline.
- **Shared defaults.** A group can set its own.

## Related terms

- [Airflow DAG](https://learn.benibix.com/term/data/airflow-dag)
- [Airflow Task](https://learn.benibix.com/term/data/airflow-task)
- [Fan-Out and Fan-In](https://learn.benibix.com/term/data/fan-out-fan-in)
- [Apache Airflow](https://learn.benibix.com/term/data/apache-airflow)
- [Airflow TaskFlow API](https://learn.benibix.com/term/data/airflow-taskflow-api)

![A task called list regions splits into three highlighted tasks, load Europe, load Asia and load Americas, inside a dashed box named task group load_regions. All three lead into one task, build report, which waits for all 3. Labels below read fan-out and fan-in.](https://learn.benibix.com/diagrams/dat2-fan-out-in.svg)

---

Source: https://learn.benibix.com/term/data/airflow-task-group
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
