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

# pattern

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

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

## Meaning and placement

### typeExpr · oneOf · 2 → string

The schema declares this field at the location below.

| Property        | Declaration                                                    |
| --------------- | -------------------------------------------------------------- |
| Requirement     | Optional in this object                                        |
| Schema location | `/$defs/typeExpr/oneOf/2/properties/string/properties/pattern` |
| type            | "string"                                                       |
| maxLength       | 512                                                            |

**In the same object:** [max\_len](/reference/language/words/max_len) · [min\_len](/reference/language/words/min_len)

[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/human-gated-ship.nika.yaml`, source lines 94–103. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
    invoke:
      tool: "nika:grep"
      args:
        pattern: "${{ const.version_pattern }}"
        path: "${{ const.evidence_dir }}"
    on_error:
      # Rehearsal · in an EMPTY directory the walk finds no `./release` and
      # fails NIKA-BUILTIN-GREP-001 (measured); recovering to one match keeps
      # the scaffold green the moment it is scaffolded. `on_codes:` keeps that
      # narrow — a permission refusal still fails loudly. DELETE this block once
```

### Templates containing this field

| Template                               | Source                                                                                                                                       |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `templates/human-gated-ship.nika.yaml` | [Line 97](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/human-gated-ship.nika.yaml#L97) |

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

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