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

# with

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

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

## Meaning and placement

### task

Task-level scope injection · `${{ with.X }}`.

| Property | Declaration |
| - | - |
| Requirement | Optional in this object |
| Schema location | `/$defs/task/properties/with` |
| type | `"object"` |

**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) · [timeout](https://docs.nika.sh/reference/language/words/timeout.md) · [when](https://docs.nika.sh/reference/language/words/when.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/agent-loop.nika`, source lines 66–75. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
          steps: { type: array, items: { type: string } }

  execute:
    with:
      # BOTH bindings, on purpose. The plan is a summary of the goal, never a
      # substitute for it: measured on five real seats, a prompt that carried
      # only the plan produced three GREEN runs with an invented or an empty
      # answer — the agent was asked to compute over data it never received,
      # and the assert below only proves non-emptiness. The goal rides in.
      goal: ${{ inputs.goal }}
```

### Templates containing this field

| Template | Source |
| - | - |
| `templates/agent-loop.nika` | [Line 69](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/agent-loop.nika#L69) |
| `templates/aggregate-by-key.nika` | [Line 52](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/aggregate-by-key.nika#L52) |
| `templates/bounded-batch.nika` | [Line 38](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/bounded-batch.nika#L38) |
| `templates/chain.nika` | [Line 63](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/chain.nika#L63) |
| `templates/classify-and-route.nika` | [Line 93](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/classify-and-route.nika#L93) |
| `templates/corpus-qa.nika` | [Line 39](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/corpus-qa.nika#L39) |
| `templates/deduplicate-records.nika` | [Line 51](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/deduplicate-records.nika#L51) |
| `templates/docker-report.nika` | [Line 66](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/docker-report.nika#L66) |
| `templates/document-to-fields.nika` | [Line 45](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/document-to-fields.nika#L45) |
| `templates/etl-state.nika` | [Line 86](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/etl-state.nika#L86) |
| `templates/evaluate-and-optimize.nika` | [Line 51](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/evaluate-and-optimize.nika#L51) |
| `templates/fanout.nika` | [Line 95](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/fanout.nika#L95) |
| `templates/gate-and-act.nika` | [Line 67](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/gate-and-act.nika#L67) |
| `templates/human-gated-ship.nika` | [Line 123](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/human-gated-ship.nika#L123) |
| `templates/media-asset-pack.nika` | [Line 69](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/media-asset-pack.nika#L69) |
| `templates/parallel-review.nika` | [Line 63](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/parallel-review.nika#L63) |
| `templates/project-public-fields.nika` | [Line 59](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/project-public-fields.nika#L59) |
| `templates/recover-optional-file.nika` | [Line 40](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/recover-optional-file.nika#L40) |
| `templates/snapshot-diff.nika` | [Line 55](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/snapshot-diff.nika#L55) |
| `templates/validate-records.nika` | [Line 49](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/validate-records.nika#L49) |
| `templates/website-brief.nika` | [Line 60](https://github.com/supernovae-st/nika-spec/blob/4e259e5b8012fcdf92f094142a52dfef24099b85/templates/website-brief.nika#L60) |

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:with`. 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.