> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# retry

> Contract, placement, related fields and source examples for this Nika YAML field.

[Language reference](/reference/language/overview) / `retry`

## Meaning and placement

### task

Retry policy for this task · `&#123; max_attempts, backoff_ms, backoff_strategy, backoff_max_ms, jitter, on_codes &#125;`. Retries run BEFORE `on_error` sees anything — the catch handles the last error only (spec/05-errors.md §Retry policy).

| Property        | Declaration                    |
| --------------- | ------------------------------ |
| Requirement     | Optional in this object        |
| Schema location | `/$defs/task/properties/retry` |
| \$ref           | "#/\$defs/retry"               |

**In the same object:** [after](/reference/language/words/after) · [agent](/reference/language/words/agent) · [exec](/reference/language/words/exec) · [extract](/reference/language/words/extract) · [for\_each](/reference/language/words/for_each) · [group](/reference/language/words/group) · [infer](/reference/language/words/infer) · [invoke](/reference/language/words/invoke) · [lift](/reference/language/words/lift) · [on\_error](/reference/language/words/on_error) · [returns](/reference/language/words/returns) · [timeout](/reference/language/words/timeout) · [when](/reference/language/words/when) · [with](/reference/language/words/with)

[Schema source (use the pointer above)](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/schemas/workflow.schema.json)

## In a source template

Excerpt from `templates/fanout.nika.yaml`, source lines 119–128. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
      max_parallel: 4                 # SLOT: the polite ceiling
      fail_fast: false
    timeout: "60s"                  # SLOT: per-iteration bound
    retry:
      max_attempts: 3
      backoff_strategy: exponential
      jitter: true
    on_error:
      recover: null                 # a failed item yields null at its index · the batch lives
    infer:                          # SLOT: the per-item job (any verb)
```

### Templates containing this field

| Template                     | Source                                                                                                                               |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `templates/fanout.nika.yaml` | [Line 122](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/fanout.nika.yaml#L122) |

These are literal key occurrences in the source files, not an execution or conformance claim. [How to instantiate a template](/guides/templates).

## Contract and implementation

This page projects the named specification revision. Check [released engine status](/reference/status) and [the validation workflow](/guides/agent-authoring) before running a file. An optional field is not evidence that every engine supports every value.

Canonical identity: `language:word:retry`. Spec revision: [`c5ebbb7b862b`](https://github.com/supernovae-st/nika-spec/tree/c5ebbb7b862b68bc6cf7235efba61173b844afc6).

[How documentation stays connected](/reference/knowledge-system).
