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

# extract

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

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

## Meaning and placement

### task

Named jq-expression bindings extracted from the verb's raw response · read downstream as `$&#123;&#123; tasks.X.&lt;name&gt; &#125;&#125;`. The field names the OPERATION (run this jq); it does not write `output` — `$&#123;&#123; tasks.X.output &#125;&#125;` stays the raw response (spec/03-dag.md §extract). jq is the single data extraction-and-transform language (the former RFC 9535 JSONPath was dropped · jq is a superset · per spec/04-variables.md §216-225). A binding may not shadow a record projection: output · status · error · started\_at · ended\_at · duration\_ms are forbidden at parse time (spec/04-variables.md §Rules) — enforced via propertyNames.

| Property             | Declaration                         |
| -------------------- | ----------------------------------- |
| Requirement          | Optional in this object             |
| Schema location      | `/$defs/task/properties/extract`    |
| type                 | "object"                            |
| additionalProperties | \{"type": "string", "format": "jq"} |

**In the same object:** [after](/reference/language/words/after) · [agent](/reference/language/words/agent) · [exec](/reference/language/words/exec) · [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) · [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/document-to-fields.nika.yaml`, source lines 51–60. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
        condition: ${{ size(with.document) > 0 }}
        message: "Document is empty after whitespace is trimmed"

  extract:
    with:
      document: ${{ tasks.normalize_document.output }}
    after:
      document_nonempty: success
    infer:
      max_tokens: 600                # SLOT: extraction spend ceiling
```

### Templates containing this field

| Template                                 | Source                                                                                                                                         |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `templates/document-to-fields.nika.yaml` | [Line 54](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/document-to-fields.nika.yaml#L54) |
| `templates/gate-and-act.nika.yaml`       | [Line 58](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/gate-and-act.nika.yaml#L58)       |

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

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