> ## 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.

# timeout

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

[Language reference](https://docs.nika.sh/reference/language/overview.md) / `timeout`

## Meaning and placement

### task

Go-duration string · quoted · e.g. "30s" "5m" "1h30m" "2.5s". Max 24h.

| Property | Declaration |
| - | - |
| Requirement | Optional in this object |
| Schema location | `/$defs/task/properties/timeout` |
| type | `"string"` |
| pattern | declaration below |

<details>
  <summary>`pattern` schema declaration (spec source, not a lesson)</summary>

  ```json theme={"system"}
  "^[0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h)([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))*$"
  ```
</details>

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

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

## In a source template

Excerpt from `templates/bounded-batch.nika`, source lines 49–58. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
      items: ${{ const.items }}
      max_parallel: 2
      fail_fast: true
    timeout: 30s
    infer:
      prompt: '${{ const.brief }}

        Item: ${{ item }}'
      # a reasoning model needs 16384 here, or a documented run.reasoning.effort: low
      max_tokens: 2048
```

### Templates containing this field

| Template | Source |
| - | - |
| `templates/bounded-batch.nika` | [Line 52](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/bounded-batch.nika#L52) |
| `templates/fanout.nika` | [Line 117](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/fanout.nika#L117) |
| `templates/parallel-review.nika` | [Line 74](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/parallel-review.nika#L74) |
| `templates/project-public-fields.nika` | [Line 77](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/project-public-fields.nika#L77) |
| `templates/recover-optional-file.nika` | [Line 30](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/recover-optional-file.nika#L30) |

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

## Contract and implementation

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

Canonical identity: `language:word:timeout`. Spec revision: [`4e259e5b8012`](https://github.com/supernovae-st/nika-spec/tree/4e259e5b8012fcdf92f094142a52dfef24099b85).

[How documentation stays connected](https://docs.nika.sh/reference/knowledge-system.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.