# Task Retry

> A failed task runs again on its own. It gets a set number of tries.

**Field:** Data Engineering  
**Category:** Orchestration  
**Also known as:** Retries, Retry Policy, Retry Delay

## Think of it like

The ball missed the hoop, so you take another shot. After three misses, you ask for help.

## Definition

A task retry runs a failed task again by itself. You set how many tries it gets and how long to wait between them. Many failures pass on their own, like a busy database or a short network drop. So a second try often works. When the last try fails, the task is marked failed and someone is told. Tasks after it do not run.

## Example

A load hits a timeout at 2 am because the database is busy. Five minutes later the retry works, and no one is woken up.

## Example code

```python
@task(
    retries=3,
    retry_delay=timedelta(minutes=5),
    retry_exponential_backoff=True,
)
def load_orders():
    ...
```

An Airflow task that gets three more tries. The wait grows longer after each failure.

## Why it matters

Most night-time failures are brief. Retries turn them into a short delay instead of a broken morning report.

## Common mistake

Retrying a task that adds rows each time it runs. Each retry leaves another copy of the same data.

## Three principles

- **Count.** Set how many extra tries it gets.
- **Wait.** Leave a gap, often growing longer.
- **Then alert.** Tell a person after the last try.

## Related terms

- [Idempotent Pipeline](https://learn.benibix.com/term/data/idempotent-pipeline)
- [Retry with Exponential Backoff](https://learn.benibix.com/term/development/retry-with-backoff)
- [Workflow Orchestration](https://learn.benibix.com/term/data/workflow-orchestration)
- [Task Dependency](https://learn.benibix.com/term/data/task-dependency)
- [Pipeline Alerting](https://learn.benibix.com/term/data/pipeline-alerting)

![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-retry
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.
