> ## 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](https://docs.nika.sh/reference/language/overview.md) / `extract`

## Meaning and placement

### task

Named jq-expression bindings extracted from the verb's raw response · read downstream as `${{ tasks.X.<name> }}`. The field names the OPERATION (run this jq); it does not write `output` — `${{ tasks.X.output }}` 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 | declaration below |

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

  ```json theme={"system"}
  {
    "type": "string",
    "format": "jq"
  }
  ```
</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) · [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) · [with](https://docs.nika.sh/reference/language/words/with.md)

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

## In a source template

Excerpt from `templates/document-to-fields.nika`, source lines 50–59. 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:
      # a reasoning model needs 16384 here, or a documented run.reasoning.effort: low
```

### Templates containing this field

| Template | Source |
| - | - |
| `templates/document-to-fields.nika` | [Line 53](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/document-to-fields.nika#L53) |
| `templates/gate-and-act.nika` | [Line 58](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/gate-and-act.nika#L58) |

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

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