# Task Dependency

> A rule that one task must finish before the next one starts.

**Field:** Data Engineering  
**Category:** Orchestration  
**Also known as:** Upstream Task, Downstream Task, Pipeline Dependency

## Think of it like

You put on socks before shoes. The shoes have to wait for the socks.

## Definition

A task dependency says one task must finish before another can start. The task that goes first is upstream. The task that waits is downstream. Together the dependencies draw a graph with no loops, called a DAG. Tasks with no link between them can run at the same time. A task only runs when everything upstream has worked.

## Example

A report task depends on two load tasks. The loads run side by side, and the report starts only when both are done.

## Example code

```python
extract_orders >> join_tables
extract_payments >> join_tables
join_tables >> build_report
```

In Airflow, the arrow means the left task must finish first. The two extracts can run side by side.

## Why it matters

Links between tasks stop a report from reading half-loaded data. They also show which tasks can run side by side.

## Common mistake

Chaining every task in one long line. Tasks that do not need each other wait for no reason, and the run takes twice as long.

## Three principles

- **Upstream first.** The waiting task needs its inputs done.
- **No loops.** A task can never wait on itself.
- **Parallel by default.** Unlinked tasks run at the same time.

## Related terms

- [Workflow Orchestration](https://learn.benibix.com/term/data/workflow-orchestration)
- [Airflow DAG](https://learn.benibix.com/term/data/airflow-dag)
- [Task Retry](https://learn.benibix.com/term/data/task-retry)
- [Data Pipeline](https://learn.benibix.com/term/data/data-pipeline)
- [Fan-Out and Fan-In](https://learn.benibix.com/term/data/fan-out-fan-in)

![Five tasks joined by arrows: extract orders and extract payments both feed a join task, which feeds build report and then email team. The join task is highlighted as failed, with a loop arrow labelled retry 2 of 3.](https://learn.benibix.com/diagrams/orchestration-dag.svg)

---

Source: https://learn.benibix.com/term/data/task-dependency
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.
