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

# invoke

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

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

## Meaning and placement

### task

The schema declares this field at the location below.

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

**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) · [lift](/reference/language/words/lift) · [on\_error](/reference/language/words/on_error) · [retry](/reference/language/words/retry) · [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/agent-loop.nika.yaml`, source lines 136–145. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
      # (as above) or in a `nika:jq` law. No static law catches an INVENTED
      # answer: that gap closes upstream, by binding the goal into the agent.
      has_findings: ${{ size(tasks.execute.output.findings) > 0 }}   # the check crosses as ONE boundary expression · SLOT: your law
    invoke:
      tool: "nika:assert"
      args:
        condition: "${{ with.has_findings }}"
        message: "Agent returned no findings, do not trust an empty run"   # SLOT

outputs:
```

### Templates containing this field

| Template                                    | Source                                                                                                                                            |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `templates/agent-loop.nika.yaml`            | [Line 139](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/agent-loop.nika.yaml#L139)          |
| `templates/api-upload-and-create.nika.yaml` | [Line 69](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/api-upload-and-create.nika.yaml#L69) |
| `templates/chain.nika.yaml`                 | [Line 47](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/chain.nika.yaml#L47)                 |
| `templates/classify-and-route.nika.yaml`    | [Line 95](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/classify-and-route.nika.yaml#L95)    |
| `templates/corpus-qa.nika.yaml`             | [Line 33](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/corpus-qa.nika.yaml#L33)             |
| `templates/docker-report.nika.yaml`         | [Line 91](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/docker-report.nika.yaml#L91)         |
| `templates/document-to-fields.nika.yaml`    | [Line 39](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/document-to-fields.nika.yaml#L39)    |
| `templates/etl-state.nika.yaml`             | [Line 71](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/etl-state.nika.yaml#L71)             |
| `templates/fanout.nika.yaml`                | [Line 87](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/fanout.nika.yaml#L87)                |
| `templates/gate-and-act.nika.yaml`          | [Line 52](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/gate-and-act.nika.yaml#L52)          |
| `templates/human-gated-ship.nika.yaml`      | [Line 94](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/human-gated-ship.nika.yaml#L94)      |
| `templates/media-asset-pack.nika.yaml`      | [Line 72](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/media-asset-pack.nika.yaml#L72)      |
| `templates/website-brief.nika.yaml`         | [Line 51](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/website-brief.nika.yaml#L51)         |

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:invoke`. Spec revision: [`c5ebbb7b862b`](https://github.com/supernovae-st/nika-spec/tree/c5ebbb7b862b68bc6cf7235efba61173b844afc6).

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