> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyformat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Workflow

> Replace a workflow's typed graph atomically, echoing persistent_id to keep field identity across renames

*Rate limit tier: **general**, 600 requests/min. See [Rate limits](https://docs.anyformat.ai/api-reference-v3/introduction.md#rate-limits).*

Replaces a workflow's typed graph, atomically. The body is the `{name, description, nodes, edges}` sub-shape of [`GET /v3/workflows/{workflow_id}/`](https://docs.anyformat.ai/api-reference-v3/workflows/get). The intended loop is **GET, mutate, PATCH**.

Each update mints a new workflow version. Earlier versions stay available for historical runs. v3 has no `PUT`.

## Field identity: `persistent_id`

Every field in the GET response carries a server-assigned `persistent_id`. When you PATCH:

* **Echo `persistent_id` unchanged**, including when you rename the field. The field then keeps its identity: analytics history, ground truth and quality metrics stay attached.
* **Omit it only for a brand-new field**, and the server assigns one. A field without `persistent_id` is always new. A name that matches a prior field confers **no** identity, so omitting it on an existing field replaces that field and detaches its history.
* An echoed `persistent_id` that matches no field in the current version is rejected with `400`.
* Sending back an **unchanged graph** cuts no new version.

The response is the updated workflow in the exact GET shape, including the `persistent_id`s just assigned to new fields. Edit that response and PATCH again. The echoed graph is this request's own write result, never the state left by a concurrent update.

An invalid graph is rejected with `400 TOPOLOGY_INVALID`, on the same contract as [Create workflow](https://docs.anyformat.ai/api-reference-v3/workflows/create.md). The stored workflow stays untouched.

```bash curl theme={null}
curl -X PATCH 'https://api.anyformat.ai/v3/workflows/0686bb97-8c30-70f0-8000-97669e000eb8/' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Invoice Processing",
    "description": "Extract data from invoice documents",
    "nodes": [
      { "id": "parse_1", "type": "parse" },
      {
        "id": "extract_1",
        "type": "extract",
        "extraction_schema": {
          "fields": [
            {
              "name": "invoice_reference",
              "description": "The unique invoice identifier",
              "data_type": "string",
              "persistent_id": "8f14e45f-ceea-467f-a34e-9b6e2f7d3c1a"
            }
          ]
        }
      }
    ],
    "edges": [ { "source": "parse_1", "target": "extract_1" } ]
  }'
```

```python Python (requests) theme={null}
import requests

workflow_id = "0686bb97-8c30-70f0-8000-97669e000eb8"
url = f"https://api.anyformat.ai/v3/workflows/{workflow_id}/"
headers = {"Authorization": "Bearer YOUR_API_KEY"}

# GET → mutate → PATCH: rename a field, keep its persistent_id.
workflow = requests.get(url, headers=headers).json()
field = workflow["nodes"][1]["extraction_schema"]["fields"][0]
field["name"] = "invoice_reference"  # persistent_id stays, so identity survives the rename

body = {k: workflow[k] for k in ("name", "description", "nodes", "edges")}
updated = requests.patch(url, headers=headers, json=body).json()
print(updated["updated_at"])
```

```json Response (200 OK) theme={null}
{
  "id": "0686bb97-8c30-70f0-8000-97669e000eb8",
  "name": "Invoice Processing",
  "description": "Extract data from invoice documents",
  "created_at": "2026-07-01T12:00:00.000Z",
  "updated_at": "2026-07-05T09:30:00.000Z",
  "nodes": [
    {
      "id": "parse_1",
      "type": "parse",
      "mode": "standard",
      "prompt_hint": null,
      "figure_enhancement": false,
      "cache": true,
      "effort": "mid",
      "scanned_pages": "ocr"
    },
    {
      "id": "extract_1",
      "type": "extract",
      "mode": "standard",
      "extraction_schema": {
        "fields": [
          {
            "name": "invoice_reference",
            "description": "The unique invoice identifier",
            "data_type": "string",
            "persistent_id": "8f14e45f-ceea-467f-a34e-9b6e2f7d3c1a"
          }
        ]
      },
      "lookup_file_ids": [],
      "lookup_suggestion": null,
      "lookup_reasoning_effort": null,
      "lookup_file_uploads": [],
      "use_images": false
    }
  ],
  "edges": [ { "source": "parse_1", "target": "extract_1", "branch": null } ]
}
```


## OpenAPI

````yaml PATCH /v3/workflows/{workflow_id}/
openapi: 3.1.0
info:
  title: anyformat API
  description: >
    Document extraction and workflow automation API.


    AnyFormat lets you define extraction workflows that pull structured data
    from any document — PDFs, images, scanned files, or plain text. Upload a
    file, run it through a workflow, and get back structured fields with
    confidence scores and source evidence.


    ## Quick start


    See the [Quick start
    guide](https://docs.anyformat.ai/api-reference-v3/introduction) for a
    walkthrough.


    ## Authentication


    All endpoints (except `/health/`) require a Bearer token in the
    `Authorization` header:


    ```

    Authorization: Bearer <your-api-key>

    ```


    Get your API key from
    [app.anyformat.ai/api-key](https://app.anyformat.ai/api-key).


    ## Versioning


    Endpoints are versioned by path prefix (`/v3/`). Every response under

    a versioned prefix includes `X-API-Version`.
  version: 3.0.0
servers:
  - url: https://api.anyformat.ai
    description: API server
security: []
tags:
  - name: workflows
    description: >-
      Workflows define extraction templates — what fields to extract from
      documents. Create workflows, upload files, run extractions, and fetch
      results.
  - name: document-packets
    description: >-
      Document packets group uploaded documents for a workflow. Address a packet
      directly to (re-)run its workflow.
  - name: runs
    description: >-
      Extraction runs — the first-class result entity. Each run is a single
      execution of a workflow against a document packet; fetch its status and
      results flat by run id.
  - name: splits
    description: >-
      Splits — the sub-documents a splitter node carves out of a packet.
      Download any one of them as a PDF, built from the source documents on
      request and never stored.
  - name: webhooks
    description: >-
      Webhooks — an HTTPS endpoint of yours that hears of every run's ending,
      signed per the Standard Webhooks specification, instead of polling the
      run.
  - name: parse
    description: >-
      Parse a single document with the platform's fast lite parse — a one-call
      shortcut over the workflow upload + run primitives, backed by your
      organization's system parse workflow.
  - name: health
    description: Health check endpoints to verify API availability.
paths:
  /v3/workflows/{workflow_id}/:
    patch:
      tags:
        - workflows
      summary: Update workflow
      description: |-
        Replace a workflow's typed graph (atomic).

        The body is the `{name, description, nodes, edges}` sub-shape of
        `GET /v3/workflows/{workflow_id}/` — GET, mutate, PATCH. Echo each
        existing field's `persistent_id` unchanged (including across
        renames) to keep the field's identity, so analytics, ground truth
        and quality metrics stay attached; omit `persistent_id` only for
        genuinely new fields (a pidless field is always treated as new —
        name coincidence with a prior field does NOT confer identity). An
        echoed `persistent_id` that doesn't match any field in the current
        version is a 400. Responds with the updated workflow in the exact
        `GET /v3/workflows/{workflow_id}/` shape, so the result can be
        edited and PATCHed again. The returned graph is this request's own
        write result — including the `persistent_id`s assigned to new
        fields — never the state left by a concurrent update.
      operationId: v3_update_workflow
      parameters:
        - name: workflow_id
          in: path
          required: true
          schema:
            type: string
            title: Workflow Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/WorkflowUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowReadV3'
          headers:
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
        '400':
          description: >-
            `VALIDATION_ERROR` — The request failed validation. `detail` is a
            list of `{type, loc, msg}`, one per failure; `loc[0]` is the request
            part.

            `TOPOLOGY_INVALID` — The workflow topology is not valid.

            `LOOKUP_FIELD_WITHOUT_FILE` — A lookup field has no lookup file.

            `INVALID_LOOKUP_FILE_ENCODING` — The lookup file uses an encoding
            the server cannot read.

            `UNSUPPORTED_LOOKUP_FILE` — The lookup file type is not supported.

            `INVALID_WORKFLOW_CONFIG` — The workflow holds a node configuration
            that is not valid.

            `OPERATOR_NOT_AVAILABLE` — This workflow uses an operator that is no
            longer available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                VALIDATION_ERROR:
                  value:
                    error: The request failed validation.
                    detail:
                      - type: missing
                        loc:
                          - body
                          - name
                        msg: Field required
                    error_code: VALIDATION_ERROR
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Read `detail` for what failed validation, correct the
                      request, and send it again.
                TOPOLOGY_INVALID:
                  value:
                    error: The workflow topology is not valid.
                    detail: The workflow topology is not valid.
                    error_code: TOPOLOGY_INVALID
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Fix the node connections `detail` names so the graph is
                      valid, and save again.
                LOOKUP_FIELD_WITHOUT_FILE:
                  value:
                    error: A lookup field has no lookup file.
                    detail: A lookup field has no lookup file.
                    error_code: LOOKUP_FIELD_WITHOUT_FILE
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Attach a lookup file to every lookup field, or remove the
                      field, and save again.
                INVALID_LOOKUP_FILE_ENCODING:
                  value:
                    error: The lookup file uses an encoding the server cannot read.
                    detail: The lookup file uses an encoding the server cannot read.
                    error_code: INVALID_LOOKUP_FILE_ENCODING
                    retryable: false
                    request_id: req_abc123
                    recovery: Save the lookup file as UTF-8 and upload it again.
                UNSUPPORTED_LOOKUP_FILE:
                  value:
                    error: The lookup file type is not supported.
                    detail: The lookup file type is not supported.
                    error_code: UNSUPPORTED_LOOKUP_FILE
                    retryable: false
                    request_id: req_abc123
                    recovery: Upload the lookup file as UTF-8 text or CSV.
                INVALID_WORKFLOW_CONFIG:
                  value:
                    error: The workflow holds a node configuration that is not valid.
                    detail: The workflow holds a node configuration that is not valid.
                    error_code: INVALID_WORKFLOW_CONFIG
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Fix the node configuration `detail` names and save the
                      workflow again.
                OPERATOR_NOT_AVAILABLE:
                  value:
                    error: >-
                      This workflow uses an operator that is no longer
                      available.
                    detail: >-
                      This workflow uses an operator that is no longer
                      available.
                    error_code: OPERATOR_NOT_AVAILABLE
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Replace the operator on the nodes in `params.node_ids`
                      with a supported one, and save again.
        '401':
          description: >-
            Authentication failed — the API key is not valid (`INVALID_API_KEY`)
            or the request carries none (`MISSING_API_KEY`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                INVALID_API_KEY:
                  value:
                    error: The API key is not valid.
                    detail: The API key is not valid.
                    error_code: INVALID_API_KEY
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Check that the key is complete and has not been revoked,
                      or create a new key.
                MISSING_API_KEY:
                  value:
                    error: The request carries no API key.
                    detail: The request carries no API key.
                    error_code: MISSING_API_KEY
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Send your API key in the `Authorization: Bearer <key>`
                      header.
        '403':
          description: >-
            `PARSE_MODE_FORBIDDEN` — This organization cannot use that parse
            mode.

            `EXTRACT_MODE_FORBIDDEN` — This organization cannot use that extract
            mode.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                PARSE_MODE_FORBIDDEN:
                  value:
                    error: This organization cannot use that parse mode.
                    detail: This organization cannot use that parse mode.
                    error_code: PARSE_MODE_FORBIDDEN
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Choose a parse mode the organization's plan includes, or
                      contact support to enable this one.
                EXTRACT_MODE_FORBIDDEN:
                  value:
                    error: This organization cannot use that extract mode.
                    detail: This organization cannot use that extract mode.
                    error_code: EXTRACT_MODE_FORBIDDEN
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Choose an extract mode the organization's plan includes,
                      or contact support to enable this one.
        '404':
          description: >-
            Resource not found — the workflow, document packet, or run ID does
            not exist or is not visible to this API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                NOT_FOUND:
                  value:
                    error: The resource does not exist.
                    detail: The resource does not exist.
                    error_code: NOT_FOUND
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Check the ID, and that it belongs to your API key's
                      organization; `params.resource_type` names what is
                      missing.
        '409':
          description: >-
            `IMMUTABLE_WORKFLOW` — This is a system workflow and it cannot
            change.

            `WORKFLOW_NAME_CONFLICT` — A workflow with that name already exists.

            `deprecated_operator_ack_required` — This workflow uses a deprecated
            operator, so the save needs an acknowledgement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                IMMUTABLE_WORKFLOW:
                  value:
                    error: This is a system workflow and it cannot change.
                    detail: This is a system workflow and it cannot change.
                    error_code: IMMUTABLE_WORKFLOW
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Make the change on a workflow of your own, because a
                      system workflow never changes.
                WORKFLOW_NAME_CONFLICT:
                  value:
                    error: A workflow with that name already exists.
                    detail: A workflow with that name already exists.
                    error_code: WORKFLOW_NAME_CONFLICT
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Choose a different workflow name and send the request
                      again.
                deprecated_operator_ack_required:
                  value:
                    error: >-
                      This workflow uses a deprecated operator, so the save
                      needs an acknowledgement.
                    detail: >-
                      This workflow uses a deprecated operator, so the save
                      needs an acknowledgement.
                    error_code: deprecated_operator_ack_required
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Replace the operator on the nodes in `params.node_ids`,
                      then save again.
        '429':
          description: >-
            Rate limited — retry after the `Retry-After` header. Default
            windows: 60 requests/minute for extraction submission, 600
            requests/minute for general endpoints.
          headers:
            Retry-After:
              description: Seconds until the next request is allowed.
              schema:
                type: integer
            X-RateLimit-Limit:
              description: Requests allowed per window (60s).
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                RATE_LIMITED:
                  value:
                    error: Too many requests.
                    detail: Too many requests.
                    error_code: RATE_LIMITED
                    retryable: true
                    request_id: req_abc123
                    recovery: >-
                      Wait the seconds the `Retry-After` header gives, or back
                      off exponentially without one, then retry.
        '500':
          description: >-
            An internal error stopped the request — `retryable=true`. Retry with
            backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                INTERNAL_ERROR:
                  value:
                    error: An internal error stopped the request.
                    detail: An internal error stopped the request.
                    error_code: INTERNAL_ERROR
                    retryable: true
                    request_id: req_abc123
                    recovery: >-
                      Retry with exponential backoff, and contact support with
                      the `request_id` if it keeps failing.
        '502':
          description: >-
            A backend service broke the connection before it answered, or
            failed. Retry with backoff when `retryable` is true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                INTERNAL_ERROR:
                  value:
                    error: An internal error stopped the request.
                    detail: An internal error stopped the request.
                    error_code: INTERNAL_ERROR
                    retryable: true
                    request_id: req_abc123
                    recovery: >-
                      Retry with exponential backoff, and contact support with
                      the `request_id` if it keeps failing.
        '503':
          description: >-
            `WORKFLOW_CONCURRENT_EDIT` — Another request is editing this
            workflow.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                WORKFLOW_CONCURRENT_EDIT:
                  value:
                    error: Another request is editing this workflow.
                    detail: Another request is editing this workflow.
                    error_code: WORKFLOW_CONCURRENT_EDIT
                    retryable: false
                    request_id: req_abc123
                    recovery: >-
                      Wait for the other edit to finish, fetch the workflow
                      again, and reapply your change.
                SERVICE_UNAVAILABLE:
                  value:
                    error: The service is temporarily unavailable.
                    detail: The service is temporarily unavailable.
                    error_code: SERVICE_UNAVAILABLE
                    retryable: true
                    request_id: req_abc123
                    recovery: Retry the request with exponential backoff.
        '504':
          description: >-
            A backend service did not answer in time. Retry with backoff when
            `retryable` is true.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorEnvelope'
              examples:
                GATEWAY_TIMEOUT:
                  value:
                    error: The upstream service did not answer in time.
                    detail: The upstream service did not answer in time.
                    error_code: GATEWAY_TIMEOUT
                    retryable: true
                    request_id: req_abc123
                    recovery: Retry the request with exponential backoff.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    WorkflowUpdateRequest:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
          examples:
            - Invoice or receipt
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          default: ''
        nodes:
          items:
            oneOf:
              - $ref: '#/components/schemas/PublicParseNode'
              - $ref: '#/components/schemas/ClassifyNode'
              - $ref: '#/components/schemas/SplitterNode'
              - $ref: '#/components/schemas/PublicExtractNode'
              - $ref: '#/components/schemas/PublicValidateNode'
              - $ref: '#/components/schemas/PublicIfElseNode'
              - $ref: '#/components/schemas/PublicSlackAlertNode'
              - $ref: '#/components/schemas/PublicEditNode'
              - $ref: '#/components/schemas/PublicCodeNode'
              - $ref: '#/components/schemas/KnowledgeNode'
              - $ref: '#/components/schemas/ReportGeneratorNode'
            discriminator:
              propertyName: type
              mapping:
                classify: '#/components/schemas/ClassifyNode'
                code: '#/components/schemas/PublicCodeNode'
                edit: '#/components/schemas/PublicEditNode'
                extract: '#/components/schemas/PublicExtractNode'
                if_else: '#/components/schemas/PublicIfElseNode'
                knowledge: '#/components/schemas/KnowledgeNode'
                parse: '#/components/schemas/PublicParseNode'
                report_generator: '#/components/schemas/ReportGeneratorNode'
                slack_alert: '#/components/schemas/PublicSlackAlertNode'
                splitter: '#/components/schemas/SplitterNode'
                validate: '#/components/schemas/PublicValidateNode'
          type: array
          minItems: 1
          title: Nodes
        edges:
          items:
            $ref: '#/components/schemas/Edge'
          type: array
          title: Edges
      additionalProperties: false
      type: object
      required:
        - name
        - nodes
      title: WorkflowUpdateRequest
      description: >-
        Public-surface workflow update body — full replacement of the typed
        graph.


        Echo each existing field's ``persistent_id`` (from ``GET``) unchanged —

        including across renames — to keep the field's identity; omit it for

        new fields. Restricts the node union to the public types (see

        ``WorkflowCreateRequest``). Call :meth:`to_domain` before forwarding to

        the backend.
      examples:
        - description: Pull the invoice number and total from each document.
          edges:
            - source: parse
              target: extract
          name: Invoice totals
          nodes:
            - id: parse
              mode: standard
              type: parse
            - extraction_schema:
                fields:
                  - data_type: string
                    description: Invoice number as printed on the document.
                    name: invoice_number
                    persistent_id: 0686bb97-8c30-70f0-8000-97669e00aaaa
                  - data_type: float
                    description: Invoice total in the document's currency.
                    name: total_amount
              id: extract
              mode: standard
              type: extract
    WorkflowReadV3:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the workflow (hyphenated UUID).
          examples:
            - 0686bb97-8c30-70f0-8000-97669e000eb8
        name:
          type: string
          title: Name
          description: Human-readable name of the workflow.
          examples:
            - Invoice Processing
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description of what this workflow extracts.
          examples:
            - A workflow for processing invoices and retrieving invoice details.
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
          description: Timestamp when the workflow was created (ISO 8601).
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
          description: Timestamp when the workflow was last modified (ISO 8601).
        nodes:
          items:
            oneOf:
              - $ref: '#/components/schemas/PublicParseNode'
              - $ref: '#/components/schemas/ClassifyNode'
              - $ref: '#/components/schemas/SplitterNode'
              - $ref: '#/components/schemas/PublicExtractNode'
              - $ref: '#/components/schemas/PublicValidateNode'
              - $ref: '#/components/schemas/PublicIfElseNode'
              - $ref: '#/components/schemas/PublicSlackAlertNode'
              - $ref: '#/components/schemas/PublicEditNode'
              - $ref: '#/components/schemas/PublicCodeNode'
              - $ref: '#/components/schemas/KnowledgeNode'
              - $ref: '#/components/schemas/ReportGeneratorNode'
            discriminator:
              propertyName: type
              mapping:
                classify: '#/components/schemas/ClassifyNode'
                code: '#/components/schemas/PublicCodeNode'
                edit: '#/components/schemas/PublicEditNode'
                extract: '#/components/schemas/PublicExtractNode'
                if_else: '#/components/schemas/PublicIfElseNode'
                knowledge: '#/components/schemas/KnowledgeNode'
                parse: '#/components/schemas/PublicParseNode'
                report_generator: '#/components/schemas/ReportGeneratorNode'
                slack_alert: '#/components/schemas/PublicSlackAlertNode'
                splitter: '#/components/schemas/SplitterNode'
                validate: '#/components/schemas/PublicValidateNode'
          type: array
          title: Nodes
          description: >-
            Typed graph nodes (parse / classify / splitter / extract / validate
            / if_else).
        edges:
          items:
            $ref: '#/components/schemas/Edge'
          type: array
          title: Edges
          description: Directed edges between the graph nodes.
        workflow_version_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Workflow Version Id
          description: >-
            The version of the graph: on GET the latest or the `?version=` one,
            on PATCH the one the write made. A `version_id` from `GET
            /v3/workflows/{workflow_id}/versions/`.
          examples:
            - FGaV4I2JAA
      type: object
      required:
        - id
        - name
        - nodes
      title: WorkflowReadV3
      description: >-
        `GET` and `PATCH /v3/workflows/{workflow_id}/`: the graph, and the
        version it belongs to.
    ErrorEnvelope:
      type: object
      title: ErrorEnvelope
      description: >-
        Uniform error response. `retryable=true` means the same request may
        succeed on retry (with backoff); `retryable=false` means the caller must
        change the request before retrying.
      required:
        - error
        - error_code
        - retryable
        - request_id
      properties:
        error:
          type: string
          description: Short human-readable summary.
        detail:
          description: >-
            Machine-readable detail, any JSON value. A string for most errors, a
            list of `{type, loc, msg}` objects for `VALIDATION_ERROR`, whose
            `loc` starts with `body`, `query`, `path`, `header`, `form` or
            `tool`, and an object for a structured error such as
            `FILENAME_CONFLICT` (`detail.conflicts`).
        error_code:
          type: string
          enum:
            - ACCESS_DENIED
            - AUTH_FAILED
            - CONCURRENT_EDIT
            - CONFLICT
            - DATASET_DOCUMENT_REJECTED
            - DATASET_GROUND_TRUTH_SAVE_FAILED
            - DATASET_INVALID_REQUEST
            - DATASET_UNSUPPORTED
            - EMPTY_EVAL
            - ENDPOINT_RETIRED
            - EXTRACT_MODE_FORBIDDEN
            - EXTRACT_NODE_UNRESOLVED
            - FILENAME_CONFLICT
            - FILE_TOO_LARGE
            - GATEWAY_TIMEOUT
            - GONE
            - GRAPH_READBACK_FAILED
            - GT_INVALID
            - IDEMPOTENCY_KEY_REUSED
            - IMMUTABLE_WORKFLOW
            - INSUFFICIENT_CREDIT
            - INTERNAL_ERROR
            - INTERNAL_INCONSISTENCY
            - INVALID_API_KEY
            - INVALID_JSON
            - INVALID_LOOKUP_FILE_ENCODING
            - INVALID_VALUE
            - INVALID_WORKFLOW_CONFIG
            - KNOWLEDGE_DOWNLOAD_UNAVAILABLE
            - KNOWLEDGE_NOT_ENABLED
            - KNOWLEDGE_NOT_READY
            - KNOWLEDGE_THREAD_MISMATCH
            - KNOWLEDGE_UNSUPPORTED_SNAPSHOT_FORMAT
            - LOOKUP_FIELD_WITHOUT_FILE
            - METHOD_NOT_ALLOWED
            - MISSING_API_KEY
            - MULTIFILE_UNSUPPORTED
            - NOT_ACCEPTABLE
            - NOT_ASSIGNED_VERIFIER
            - NOT_FOUND
            - NOT_IMPLEMENTED
            - NOT_IN_DATASET
            - OBJECT_STORAGE_UNAVAILABLE
            - ONESHOT_SIGNALS_MISSING
            - OPERATOR_DEPRECATED
            - OPERATOR_NOT_AVAILABLE
            - OPTIMIZATION_ALREADY_RUNNING
            - PARSE_MODE_FORBIDDEN
            - PAYMENT_REQUIRED
            - PRECONDITION_FAILED
            - RATE_LIMITED
            - REPARSE_REQUIRED
            - REQUEST_REJECTED
            - REQUEST_TOO_LARGE
            - RUN_IN_PROGRESS
            - SERVICE_UNAVAILABLE
            - SPLIT_HAS_NO_PAGES
            - SPLIT_SOURCE_NOT_PDF
            - TOPOLOGY_INVALID
            - UNSUPPORTED_FILE_TYPE
            - UNSUPPORTED_LOOKUP_FILE
            - UNSUPPORTED_MEDIA_TYPE
            - UPLOAD_SNIFF_BUDGET_EXCEEDED
            - URL_UNREACHABLE
            - VALIDATION_ERROR
            - WEBHOOK_SUBSCRIPTION_LIMIT
            - WORKFLOW_CONCURRENT_EDIT
            - WORKFLOW_NAME_CONFLICT
            - ZERO_DATA_RETENTION_REFUSES_DATASET
            - ZERO_DATA_RETENTION_REFUSES_KNOWLEDGE
            - ZERO_DATA_RETENTION_REFUSES_RESULTS_QUERY
            - deprecated_operator_ack_required
            - insufficient_api_key_scope
            - terms_acceptance_required
          description: >-
            Stable identifier for programmatic handling. New values can be added
            at any time, so a client must accept a code it does not know.
          examples:
            - VALIDATION_ERROR
            - AUTH_FAILED
            - NOT_FOUND
            - PRECONDITION_FAILED
            - RATE_LIMITED
            - INTERNAL_ERROR
            - GATEWAY_TIMEOUT
        retryable:
          type: boolean
          description: True when the caller should retry (with backoff for 429/412/5xx).
        request_id:
          type: string
          description: Correlates this response with server logs.
        params:
          type: object
          additionalProperties: true
          description: >-
            Values specific to this occurrence of the error that a caller needs
            to recover, such as `node_ids` or `required_scope`, keyed by name.
            Absent when the code relays none.
        doc_url:
          type: string
          format: uri
          description: Link to the documentation of this `error_code`.
        recovery:
          type: string
          description: >-
            One sentence that says what to do next. Absent when the `error_code`
            has none, or when `retryable` differs from the code's usual value.
    PublicParseNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: parse
          title: Type
        mode:
          type: string
          enum:
            - standard
            - agentic
            - lite
            - flash
          title: Mode
          description: >-
            Parse tier. 'standard' (default): page-by-page parsing with
            reading-order correction — the best quality/speed balance for most
            documents and tables. 'agentic': adaptive parsing that works hardest
            on dense tables (50+ rows, many columns) — highest fidelity on
            complex documents; extra cost per page. 'lite' (shown as 'Fast' in
            the app): OCR-only tier — accurate OCR, no LLM call; use standard or
            agentic when the output needs LLM correction. 'flash': the PDF's own
            text layer plus layout grounding, no model call — the cheapest and
            fastest tier; a page with no text layer is OCR'd by default (see
            scanned_pages).
          default: standard
        prompt_hint:
          anyOf:
            - type: string
            - type: 'null'
          title: Prompt Hint
          description: >-
            Free-form hint that biases the parse output. Standard and agentic
            modes only; ignored in lite.
        figure_enhancement:
          type: boolean
          title: Figure Enhancement
          description: >-
            Standard mode: extract structured data from charts and images —
            extra processing per figure. Ignored in agentic and in lite.
          default: false
        annotation_reading:
          type: boolean
          title: Annotation Reading
          description: >-
            Standard mode, experimental: re-read handwritten numbers inside
            larger blocks on their own high-resolution crop, and mark
            handwriting in the markdown as <handwritten>. Ignored in agentic,
            lite and flash.
          default: false
        cache:
          type: boolean
          title: Cache
          description: >-
            Reuse parsed output when the same file was already parsed with the
            same mode and settings — a hit skips the whole parse. Disable to
            force a fresh parse.
          default: true
        effort:
          type: string
          enum:
            - low
            - mid
            - accurate
          title: Effort
          description: >-
            Agentic mode: quality/cost preset. 'low' = several times cheaper but
            more errors on dense or low-contrast tables, 'mid' (default) =
            balanced, 'accurate' = highest fidelity. (Distinct from lite
            `ocr_effort`.)
          default: mid
        ocr_effort:
          type: string
          enum:
            - medium
            - high
          title: Ocr Effort
          description: >-
            Lite mode: 'high' (default) = the strongest OCR — best accuracy on
            complex layouts, tables, and handwriting. 'medium' = faster and
            cheaper, for clean digital documents. (Distinct from agentic
            `effort`.)
          default: high
        scanned_pages:
          type: string
          enum:
            - ocr
            - skip
            - fail
          title: Scanned Pages
          description: >-
            Flash mode: what to do with a page whose text layer produced no
            words. 'ocr' (default): OCR the page and parse it like any other, at
            no extra model cost. 'skip': serve it blank and flag it, don't fail
            the parse. 'fail': raise, naming the page numbers.
          default: ocr
      additionalProperties: false
      type: object
      required:
        - id
        - type
      title: PublicParseNode
    ClassifyNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: classify
          title: Type
        user_prompt:
          anyOf:
            - type: string
            - type: 'null'
          title: User Prompt
          description: >-
            Optional extra instructions inserted between the classifier's system
            prompt and the document text.
        categories:
          items:
            $ref: '#/components/schemas/ClassifyCategory'
          type: array
          minItems: 1
          title: Categories
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - categories
      title: ClassifyNode
    SplitterNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: splitter
          title: Type
        rules:
          items:
            $ref: '#/components/schemas/SplitterRule'
          type: array
          minItems: 1
          title: Rules
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - rules
      title: SplitterNode
    PublicExtractNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: extract
          title: Type
        mode:
          type: string
          enum:
            - standard
            - agentic
            - lite
          title: Mode
          description: >-
            Extraction tier. 'standard' (default): single-pass extraction — the
            best balance for simple documents and layouts. 'agentic': multi-step
            extraction that maps every table to the schema and reasons across
            sections — for dense or cross-page tables; extra cost per page.
            'lite' (shown as 'Fast' in the app): standard extraction, faster and
            cheaper; quality may vary on complex layouts.
          default: standard
        extraction_schema:
          $ref: '#/components/schemas/ExtractionSchema'
          description: Schema for the fields this node extracts. Required.
        lookup_file_ids:
          items:
            type: string
          type: array
          title: Lookup File Ids
          description: >-
            Ids of the workflow's smart-lookup reference files this node looks
            values up in. Read it back from GET and echo it to keep the files;
            write lookup_file_uploads to add one.
        lookup_suggestion:
          anyOf:
            - type: string
            - type: 'null'
          title: Lookup Suggestion
          description: Free-form hint shown to the smart-lookup matcher.
        lookup_reasoning_effort:
          anyOf:
            - type: string
              enum:
                - minimal
                - low
                - medium
                - high
            - type: 'null'
          title: Lookup Reasoning Effort
          description: >-
            Reasoning effort for the smart-lookup matcher (gpt-5 family):
            minimal | low | medium | high. None = model default. Higher effort
            improves match reliability on noisy join keys at higher
            latency/cost.
        lookup_file_uploads:
          items:
            $ref: '#/components/schemas/LookupFileUpload'
          type: array
          title: Lookup File Uploads
          description: >-
            Inline lookup-file content for the typed create call. Each entry is
            uploaded and its new id is appended to ``lookup_file_ids``; this
            field is create-input only.
        use_images:
          type: boolean
          title: Use Images
          description: >-
            Retired — accepted for compatibility, ignored. Extraction reads the
            parsed text only.
          default: false
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - extraction_schema
      title: PublicExtractNode
    PublicValidateNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: validate
          title: Type
        rules:
          items:
            $ref: '#/components/schemas/ValidationRule'
          type: array
          minItems: 1
          title: Rules
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - rules
      title: PublicValidateNode
    PublicIfElseNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: if_else
          title: Type
        condition:
          oneOf:
            - $ref: '#/components/schemas/RangeCheck'
            - $ref: '#/components/schemas/DateCheck'
            - $ref: '#/components/schemas/ArithmeticCheck'
            - $ref: '#/components/schemas/ComparisonCheck'
            - $ref: '#/components/schemas/OneOfCheck'
            - $ref: '#/components/schemas/RegexCheck'
            - $ref: '#/components/schemas/RequiredCheck'
            - $ref: '#/components/schemas/ConfidenceCheck'
            - $ref: '#/components/schemas/ExpressionCheck'
            - $ref: '#/components/schemas/ValidationCheck'
            - $ref: '#/components/schemas/AllOfCheck'
            - $ref: '#/components/schemas/AnyOfCheck'
          title: Condition
          discriminator:
            propertyName: type
            mapping:
              all_of: '#/components/schemas/AllOfCheck'
              any_of: '#/components/schemas/AnyOfCheck'
              arithmetic: '#/components/schemas/ArithmeticCheck'
              comparison: '#/components/schemas/ComparisonCheck'
              confidence: '#/components/schemas/ConfidenceCheck'
              date: '#/components/schemas/DateCheck'
              expression: '#/components/schemas/ExpressionCheck'
              one_of: '#/components/schemas/OneOfCheck'
              range: '#/components/schemas/RangeCheck'
              regex: '#/components/schemas/RegexCheck'
              required: '#/components/schemas/RequiredCheck'
              validation: '#/components/schemas/ValidationCheck'
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - condition
      title: PublicIfElseNode
    PublicSlackAlertNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: slack_alert
          title: Type
        channel_id:
          type: string
          minLength: 1
          title: Channel Id
        channel_name:
          type: string
          minLength: 1
          title: Channel Name
        message_template:
          type: string
          minLength: 1
          title: Message Template
        severity:
          type: string
          enum:
            - info
            - warning
            - critical
          title: Severity
          default: info
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - channel_id
        - channel_name
        - message_template
      title: PublicSlackAlertNode
      description: >-
        Terminal alert-sink. ``field_index`` is executor-injected — omitted
        here.
    PublicEditNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: edit
          title: Type
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: >-
            Free-text values to map onto the fillable fields detected on the
            upstream parse's PDF, e.g. 'Name: ACME SL; Date: 2026-01-01; I
            accept the terms: yes'. Takes precedence over a reference document
            where both address the same field.
        reference_document_ids:
          items:
            type: string
          type: array
          title: Reference Document Ids
          description: >-
            Ids of reference documents this node fills from, uploaded to the
            workflow beforehand. Every id must belong to this workflow and be
            fully resolved, or the run is refused rather than filled from a
            partial reference.
        font:
          type: string
          enum:
            - sans
            - serif
            - mono
          title: Font
          description: Typeface the filled values are written in.
          default: sans
        output_mode:
          type: string
          enum:
            - flattened
            - editable
          title: Output Mode
          description: >-
            'flattened' paints the values on and the PDF is final. 'editable'
            leaves each value in a live form field a reviewer can correct in any
            PDF viewer.
          default: flattened
      additionalProperties: false
      type: object
      required:
        - id
        - type
      title: PublicEditNode
      description: >-
        Terminal form-filler. ``reference_uris`` is resolved server-side at run

        time from ``reference_document_ids`` — omitted here, and any
        client-supplied

        value is discarded rather than trusted.
    PublicCodeNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: code
          title: Type
        code:
          type: string
          minLength: 1
          title: Code
          description: >-
            Beta. Python source defining `def transform(input_data: Input) ->
            Output`. `Input` and `Output` are pydantic models the sandbox
            provides; the function runs without network access. At most 65536
            bytes. Its shape may change without a version.
        output_schema:
          $ref: '#/components/schemas/ExtractionSchema'
          description: >-
            Beta. The fields of `Output`, in the extraction-schema format.
            Required.
      additionalProperties: false
      type: object
      required:
        - id
        - type
        - code
        - output_schema
      title: PublicCodeNode
      description: >-
        Beta. Terminal function node. The deprecated `instructions` and
        `template` are refused.
    KnowledgeNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: knowledge
          title: Type
      additionalProperties: false
      type: object
      required:
        - id
        - type
      title: KnowledgeNode
      description: |-
        Terminal knowledge sink — its presence opts the workflow into the
        knowledge base (priced separately, so absent by default).

        The backend reacts to parse callbacks by ingesting parsed markdown into
        the workflow's navigable corpus; core never executes this node — the
        execution builder keeps it and its edges off the worker message. Emits
        nothing downstream.
    ReportGeneratorNode:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable identifier for this node within the graph.
        type:
          type: string
          const: report_generator
          title: Type
        instructions:
          type: string
          title: Instructions
          description: Additional instructions for filling the Markdown template.
          default: ''
        example_report:
          anyOf:
            - type: string
            - type: 'null'
          title: Example Report
          description: >-
            Markdown template to fill with extracted data. Capped at 65536
            bytes.
      additionalProperties: false
      type: object
      required:
        - id
        - type
      title: ReportGeneratorNode
      description: A terminal Markdown report over a direct ExtractNode's output.
    Edge:
      properties:
        source:
          type: string
          minLength: 1
          title: Source
        target:
          type: string
          minLength: 1
          title: Target
        branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Branch
          description: >-
            Source-port label for branch routing. Required when leaving a
            classify or splitter node by category/rule.
      additionalProperties: false
      type: object
      required:
        - source
        - target
      title: Edge
      description: >-
        A directed edge between two nodes. ``branch`` carries the source-port
        label

        used for routing out of ``classify`` (category id) or ``splitter`` (rule
        id) nodes.
    ClassifyCategory:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable category id used as the edge `branch` value when routing.
        name:
          type: string
          minLength: 1
          title: Name
          description: >-
            Display name shown to the LLM; classification and routing key off
            it, so it must be unique across categories.
        description:
          type: string
          minLength: 1
          title: Description
          description: Free-form description shown to the LLM.
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - description
      title: ClassifyCategory
    SplitterRule:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
        name:
          type: string
          minLength: 1
          title: Name
        description:
          type: string
          minLength: 1
          title: Description
        partition_key:
          type: string
          title: Partition Key
          description: >-
            Field that further partitions this category into separate
            sub-documents (e.g. invoice_number): each distinct value becomes its
            own split, extracted independently. Empty = routing-only, the whole
            category flows on as one document.
          default: ''
      additionalProperties: false
      type: object
      required:
        - id
        - name
        - description
      title: SplitterRule
    ExtractionSchema:
      properties:
        fields:
          items:
            oneOf:
              - $ref: '#/components/schemas/StringField'
              - $ref: '#/components/schemas/IntegerField'
              - $ref: '#/components/schemas/FloatField'
              - $ref: '#/components/schemas/BooleanField'
              - $ref: '#/components/schemas/DateField'
              - $ref: '#/components/schemas/DatetimeField'
              - $ref: '#/components/schemas/EnumField'
              - $ref: '#/components/schemas/MultiSelectField'
              - $ref: '#/components/schemas/ObjectField'
            discriminator:
              propertyName: data_type
              mapping:
                boolean: '#/components/schemas/BooleanField'
                date: '#/components/schemas/DateField'
                datetime: '#/components/schemas/DatetimeField'
                enum: '#/components/schemas/EnumField'
                float: '#/components/schemas/FloatField'
                integer: '#/components/schemas/IntegerField'
                multi_select: '#/components/schemas/MultiSelectField'
                object: '#/components/schemas/ObjectField'
                string: '#/components/schemas/StringField'
          type: array
          minItems: 1
          title: Fields
          description: Field definitions making up this extract's output.
      additionalProperties: false
      type: object
      required:
        - fields
      title: ExtractionSchema
      description: |-
        Schema describing what an extract node produces.

        Modeled as a typed object (not a bare ``list[AnyField]``) so metadata
        can be added later (versioning, derived flags, output-shape hints)
        without another wire-format break. At least one field is required.
    LookupFileUpload:
      properties:
        filename:
          type: string
          minLength: 1
          title: Filename
        content:
          type: string
          minLength: 1
          title: Content
          description: Base64-encoded file bytes.
      additionalProperties: false
      type: object
      required:
        - filename
        - content
      title: LookupFileUpload
      description: |-
        Inline lookup-file content carried on the typed create call.

        The backend reads ``filename`` + ``content`` (base64-encoded bytes),
        uploads the file, and appends the new lookup file's id to
        ``ExtractNode.lookup_file_ids``. Create-input only — not persisted on
        the node after upload.
    ValidationRule:
      properties:
        id:
          type: string
          minLength: 1
          title: Id
          description: Stable rule id; round-trips through validation results.
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
          description: >-
            Optional human-readable rule name. Round-trips through the config
            endpoint so renames are preserved.
        kind:
          type: string
          enum:
            - ai
            - deterministic
          title: Kind
          description: >-
            'deterministic' = a structured check run in code — instant, free,
            reproducible; 'ai' = a model judges the rule description against the
            extraction. Prefer deterministic whenever the condition is exact and
            testable.
          default: ai
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: >-
            Natural-language description sent to the LLM. Required when kind ==
            'ai'.
        check:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/RangeCheck'
                - $ref: '#/components/schemas/DateCheck'
                - $ref: '#/components/schemas/ArithmeticCheck'
                - $ref: '#/components/schemas/ComparisonCheck'
                - $ref: '#/components/schemas/OneOfCheck'
                - $ref: '#/components/schemas/RegexCheck'
                - $ref: '#/components/schemas/RequiredCheck'
                - $ref: '#/components/schemas/ConfidenceCheck'
                - $ref: '#/components/schemas/ExpressionCheck'
                - $ref: '#/components/schemas/ValidationCheck'
                - $ref: '#/components/schemas/AllOfCheck'
                - $ref: '#/components/schemas/AnyOfCheck'
              discriminator:
                propertyName: type
                mapping:
                  all_of: '#/components/schemas/AllOfCheck'
                  any_of: '#/components/schemas/AnyOfCheck'
                  arithmetic: '#/components/schemas/ArithmeticCheck'
                  comparison: '#/components/schemas/ComparisonCheck'
                  confidence: '#/components/schemas/ConfidenceCheck'
                  date: '#/components/schemas/DateCheck'
                  expression: '#/components/schemas/ExpressionCheck'
                  one_of: '#/components/schemas/OneOfCheck'
                  range: '#/components/schemas/RangeCheck'
                  regex: '#/components/schemas/RegexCheck'
                  required: '#/components/schemas/RequiredCheck'
                  validation: '#/components/schemas/ValidationCheck'
            - type: 'null'
          title: Check
          description: >-
            Structured deterministic check. Required when kind ==
            'deterministic'.
        severity:
          type: string
          enum:
            - error
            - warning
          title: Severity
          description: >-
            How a failed rule is labelled in results. Display-level only — it
            never blocks the run.
          default: error
        source_fields:
          items:
            type: string
          type: array
          title: Source Fields
          description: Persistent ids of fields this rule references.
      additionalProperties: false
      type: object
      required:
        - id
      title: ValidationRule
    RangeCheck:
      properties:
        type:
          type: string
          const: range
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The bounded numeric field. Either the field's ``persistent_id``
            (Studio field-picker path) or its ``sanitized_name`` as it appears
            in the extraction response (SDK/API/assistant path) — the executor
            resolves both.
        min:
          anyOf:
            - type: number
            - type: 'null'
          title: Min
        max:
          anyOf:
            - type: number
            - type: 'null'
          title: Max
      additionalProperties: false
      type: object
      required:
        - type
        - field
      title: RangeCheck
    DateCheck:
      properties:
        type:
          type: string
          const: date
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The date field. Either the field's ``persistent_id`` (Studio
            field-picker path) or its ``sanitized_name`` as it appears in the
            extraction response (SDK/API/assistant path) — the executor resolves
            both.
        earliest:
          anyOf:
            - type: string
            - type: 'null'
          title: Earliest
        latest:
          anyOf:
            - type: string
            - type: 'null'
          title: Latest
      additionalProperties: false
      type: object
      required:
        - type
        - field
      title: DateCheck
    ArithmeticCheck:
      properties:
        type:
          type: string
          const: arithmetic
          title: Type
        operands:
          items:
            type: string
          type: array
          minItems: 1
          title: Operands
          description: >-
            The fields combined by `operator`. Either the field's
            ``persistent_id`` (Studio field-picker path) or its
            ``sanitized_name`` as it appears in the extraction response
            (SDK/API/assistant path) — the executor resolves both.
        operator:
          type: string
          enum:
            - sum
            - subtract
            - product
          title: Operator
          default: sum
        equals:
          type: string
          minLength: 1
          title: Equals
          description: >-
            The field whose value the result must equal. Either the field's
            ``persistent_id`` (Studio field-picker path) or its
            ``sanitized_name`` as it appears in the extraction response
            (SDK/API/assistant path) — the executor resolves both.
        tolerance:
          type: number
          minimum: 0
          title: Tolerance
          description: Absolute slack allowed around `equals`.
          default: 0
      additionalProperties: false
      type: object
      required:
        - type
        - operands
        - equals
      title: ArithmeticCheck
    ComparisonCheck:
      properties:
        type:
          type: string
          const: comparison
          title: Type
        left:
          type: string
          minLength: 1
          title: Left
          description: >-
            The left-hand field. Either the field's ``persistent_id`` (Studio
            field-picker path) or its ``sanitized_name`` as it appears in the
            extraction response (SDK/API/assistant path) — the executor resolves
            both.
        op:
          type: string
          enum:
            - '=='
            - '!='
            - '>'
            - '>='
            - <
            - <=
          title: Op
        right:
          oneOf:
            - $ref: '#/components/schemas/_FieldOperand'
            - $ref: '#/components/schemas/_LiteralOperand'
          title: Right
          discriminator:
            propertyName: source
            mapping:
              field: '#/components/schemas/_FieldOperand'
              literal: '#/components/schemas/_LiteralOperand'
      additionalProperties: false
      type: object
      required:
        - type
        - left
        - op
        - right
      title: ComparisonCheck
    OneOfCheck:
      properties:
        type:
          type: string
          const: one_of
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The field to test. Either the field's ``persistent_id`` (Studio
            field-picker path) or its ``sanitized_name`` as it appears in the
            extraction response (SDK/API/assistant path) — the executor resolves
            both.
        allowed:
          items:
            type: string
          type: array
          minItems: 1
          title: Allowed
        case_sensitive:
          type: boolean
          title: Case Sensitive
          default: false
      additionalProperties: false
      type: object
      required:
        - type
        - field
        - allowed
      title: OneOfCheck
    RegexCheck:
      properties:
        type:
          type: string
          const: regex
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The field to match. Either the field's ``persistent_id`` (Studio
            field-picker path) or its ``sanitized_name`` as it appears in the
            extraction response (SDK/API/assistant path) — the executor resolves
            both.
        pattern:
          type: string
          minLength: 1
          title: Pattern
          description: Evaluated with google-re2 (linear time); never stdlib re.
      additionalProperties: false
      type: object
      required:
        - type
        - field
        - pattern
      title: RegexCheck
    RequiredCheck:
      properties:
        type:
          type: string
          const: required
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The field that must be present. Either the field's ``persistent_id``
            (Studio field-picker path) or its ``sanitized_name`` as it appears
            in the extraction response (SDK/API/assistant path) — the executor
            resolves both.
      additionalProperties: false
      type: object
      required:
        - type
        - field
      title: RequiredCheck
    ConfidenceCheck:
      properties:
        type:
          type: string
          const: confidence
          title: Type
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The field whose extraction confidence to compare. Either the field's
            ``persistent_id`` (Studio field-picker path) or its
            ``sanitized_name`` as it appears in the extraction response
            (SDK/API/assistant path) — the executor resolves both.
        op:
          type: string
          enum:
            - <
            - <=
            - '>'
            - '>='
            - '=='
            - '!='
          title: Op
        threshold:
          type: integer
          maximum: 100
          minimum: 0
          title: Threshold
          description: Confidence percentile 0..100.
      additionalProperties: false
      type: object
      required:
        - type
        - field
        - op
        - threshold
      title: ConfidenceCheck
    ExpressionCheck:
      properties:
        type:
          type: string
          const: expression
          title: Type
        expression:
          type: string
          maxLength: 1000
          minLength: 1
          title: Expression
      additionalProperties: false
      type: object
      required:
        - type
        - expression
      title: ExpressionCheck
      description: >-
        A CEL expression over the whole extraction, evaluated in a sandbox.


        The expression reads one root variable ``data`` and addresses fields by

        extracted name (``data.total``, ``data.lineas.map(l, l.importe)``),
        never by

        ``persistent_id`` — so ``field_ids`` returns ``[]`` for it, and a field

        rename silently breaks the rule. An expression the evaluator cannot
        parse,

        cannot answer with a boolean, or prices above its evaluation budget
        reports

        ``inconclusive``.


        ADR platform/0036 records why the CEL parser stays out of this package,
        so

        ``expression`` is unvalidated here.
    ValidationCheck:
      properties:
        type:
          type: string
          const: validation
          title: Type
        rule_id:
          type: string
          minLength: 1
          title: Rule Id
          description: Stable id of the upstream ValidationRule to route on.
        status:
          type: string
          enum:
            - fail
            - pass
            - inconclusive
          title: Status
          description: >-
            Outcome to match. ``fail`` (default) is the common case for routing
            to an alert branch.
          default: fail
      additionalProperties: false
      type: object
      required:
        - type
        - rule_id
      title: ValidationCheck
      description: |-
        Routes on the outcome of a named validation rule already run upstream.

        Reads from ``state.validation_results`` (populated by an upstream
        ``ValidateNode``), filtered to the current partition (``split_id``) so
        per-partition IfElse routing matches per-partition rule outcomes. The
        ``status`` values mirror the worker enum
        (``anyformat_core.operations.validate_rules`` — ``pass`` / ``fail`` /
        ``inconclusive``) verbatim: no translation layer, so template tokens
        like ``${validation.<rule_id>.status}`` render the same three strings
        the enum uses.

        Unlike every other ``Check`` variant this consumes no extracted fields
        (``field_ids`` returns ``[]``); the rule identity is the entire input.
        A ``rule_id`` with no matching entry evaluates to ``inconclusive`` — the
        rule didn't run for this partition, so the outcome is unknown.
    AllOfCheck:
      properties:
        type:
          type: string
          const: all_of
          title: Type
        checks:
          items:
            oneOf:
              - $ref: '#/components/schemas/RangeCheck'
              - $ref: '#/components/schemas/DateCheck'
              - $ref: '#/components/schemas/ArithmeticCheck'
              - $ref: '#/components/schemas/ComparisonCheck'
              - $ref: '#/components/schemas/OneOfCheck'
              - $ref: '#/components/schemas/RegexCheck'
              - $ref: '#/components/schemas/RequiredCheck'
              - $ref: '#/components/schemas/ConfidenceCheck'
              - $ref: '#/components/schemas/ExpressionCheck'
              - $ref: '#/components/schemas/ValidationCheck'
              - $ref: '#/components/schemas/AllOfCheck'
              - $ref: '#/components/schemas/AnyOfCheck'
            discriminator:
              propertyName: type
              mapping:
                all_of: '#/components/schemas/AllOfCheck'
                any_of: '#/components/schemas/AnyOfCheck'
                arithmetic: '#/components/schemas/ArithmeticCheck'
                comparison: '#/components/schemas/ComparisonCheck'
                confidence: '#/components/schemas/ConfidenceCheck'
                date: '#/components/schemas/DateCheck'
                expression: '#/components/schemas/ExpressionCheck'
                one_of: '#/components/schemas/OneOfCheck'
                range: '#/components/schemas/RangeCheck'
                regex: '#/components/schemas/RegexCheck'
                required: '#/components/schemas/RequiredCheck'
                validation: '#/components/schemas/ValidationCheck'
          type: array
          maxItems: 32
          minItems: 1
          title: Checks
      additionalProperties: false
      type: object
      required:
        - type
        - checks
      title: AllOfCheck
      description: >-
        AND combinator — passes iff every sub-check passes.


        Tri-state: FAIL if any child fails; else INCONCLUSIVE if any child is

        inconclusive; else PASS. Children are the same closed ``Check`` union

        (mutual recursion via forward ref) so combinators nest by construction —

        the CheckBuilder UI restricts nesting to a single level for MVP.


        ``max_length=32`` bounds runaway fan-out per combinator. Practical rules

        stay well below the cap; a legitimate use case wanting more should
        motivate

        the raise rather than land silently. Nesting-depth is bounded by
        pydantic's

        own recursion during parse.
    AnyOfCheck:
      properties:
        type:
          type: string
          const: any_of
          title: Type
        checks:
          items:
            oneOf:
              - $ref: '#/components/schemas/RangeCheck'
              - $ref: '#/components/schemas/DateCheck'
              - $ref: '#/components/schemas/ArithmeticCheck'
              - $ref: '#/components/schemas/ComparisonCheck'
              - $ref: '#/components/schemas/OneOfCheck'
              - $ref: '#/components/schemas/RegexCheck'
              - $ref: '#/components/schemas/RequiredCheck'
              - $ref: '#/components/schemas/ConfidenceCheck'
              - $ref: '#/components/schemas/ExpressionCheck'
              - $ref: '#/components/schemas/ValidationCheck'
              - $ref: '#/components/schemas/AllOfCheck'
              - $ref: '#/components/schemas/AnyOfCheck'
            discriminator:
              propertyName: type
              mapping:
                all_of: '#/components/schemas/AllOfCheck'
                any_of: '#/components/schemas/AnyOfCheck'
                arithmetic: '#/components/schemas/ArithmeticCheck'
                comparison: '#/components/schemas/ComparisonCheck'
                confidence: '#/components/schemas/ConfidenceCheck'
                date: '#/components/schemas/DateCheck'
                expression: '#/components/schemas/ExpressionCheck'
                one_of: '#/components/schemas/OneOfCheck'
                range: '#/components/schemas/RangeCheck'
                regex: '#/components/schemas/RegexCheck'
                required: '#/components/schemas/RequiredCheck'
                validation: '#/components/schemas/ValidationCheck'
          type: array
          maxItems: 32
          minItems: 1
          title: Checks
      additionalProperties: false
      type: object
      required:
        - type
        - checks
      title: AnyOfCheck
      description: |-
        OR combinator — passes iff any sub-check passes.

        Tri-state: PASS if any child passes; else INCONCLUSIVE if any child is
        inconclusive; else FAIL.

        ``max_length=32`` — see :class:`AllOfCheck` for the rationale.
    StringField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: string
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: StringField
    IntegerField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: integer
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: IntegerField
    FloatField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: float
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: FloatField
    BooleanField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: boolean
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: BooleanField
    DateField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: date
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: DateField
    DatetimeField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: datetime
          title: Data Type
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
      title: DatetimeField
    EnumField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: enum
          title: Data Type
        enum_options:
          items:
            $ref: '#/components/schemas/EnumOption'
          type: array
          minItems: 1
          title: Enum Options
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
        - enum_options
      title: EnumField
    MultiSelectField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: multi_select
          title: Data Type
        enum_options:
          items:
            $ref: '#/components/schemas/EnumOption'
          type: array
          minItems: 1
          title: Enum Options
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
        - enum_options
      title: MultiSelectField
    ObjectField:
      properties:
        persistent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Persistent Id
          description: >-
            Server-assigned stable field identity (UUID), emitted by GET
            /definition/. Echo it back on updates — including across renames —
            to keep quality metrics, ground-truth links and analytics attached
            to the field. Matching is scoped to the field's nesting level in the
            immediately-prior version; an id that matches nothing at its level,
            appears on more than one field, or is sent at workflow creation is
            rejected with 400. Omit only for genuinely new fields: there is no
            matching by name, so a field sent without one is always treated as
            new and minted a fresh id, silently detaching that field's metrics,
            ground truth and analytics.
        name:
          type: string
          minLength: 1
          title: Name
          description: Field name. Used as the key in the extraction response.
        description:
          type: string
          title: Description
          description: Free-form description shown to the extraction model.
          default: ''
        source:
          type: string
          enum:
            - extraction
            - smart_lookup
            - lookup_if_missing
          title: Source
          description: >-
            How the field gets its value: extraction (from the document),
            smart_lookup (from the lookup file, always overwrites) or
            lookup_if_missing (extracted too; the lookup only fills it where
            extraction left no value).
          default: extraction
        data_type:
          type: string
          const: object
          title: Data Type
        nested_fields:
          items:
            oneOf:
              - $ref: '#/components/schemas/StringField'
              - $ref: '#/components/schemas/IntegerField'
              - $ref: '#/components/schemas/FloatField'
              - $ref: '#/components/schemas/BooleanField'
              - $ref: '#/components/schemas/DateField'
              - $ref: '#/components/schemas/DatetimeField'
              - $ref: '#/components/schemas/EnumField'
              - $ref: '#/components/schemas/MultiSelectField'
            discriminator:
              propertyName: data_type
              mapping:
                boolean: '#/components/schemas/BooleanField'
                date: '#/components/schemas/DateField'
                datetime: '#/components/schemas/DatetimeField'
                enum: '#/components/schemas/EnumField'
                float: '#/components/schemas/FloatField'
                integer: '#/components/schemas/IntegerField'
                multi_select: '#/components/schemas/MultiSelectField'
                string: '#/components/schemas/StringField'
          type: array
          minItems: 1
          title: Nested Fields
          description: >-
            Columns of one row. The extracted value is an array of objects with
            these keys, one entry per row found. Only one level of nesting is
            supported — an object field's children must be non-object types.
      additionalProperties: false
      type: object
      required:
        - name
        - data_type
        - nested_fields
      title: ObjectField
      description: >-
        A repeating group — the way a table or line-item list is modelled.


        There is no separate list type: one ``object`` field describes the shape
        of

        a single row, and the extraction returns an array of those rows.
    _FieldOperand:
      properties:
        source:
          type: string
          const: field
          title: Source
        field:
          type: string
          minLength: 1
          title: Field
          description: >-
            The compared field. Either the field's ``persistent_id`` (Studio
            field-picker path) or its ``sanitized_name`` as it appears in the
            extraction response (SDK/API/assistant path) — the executor resolves
            both.
      additionalProperties: false
      type: object
      required:
        - source
        - field
      title: _FieldOperand
    _LiteralOperand:
      properties:
        source:
          type: string
          const: literal
          title: Source
        value:
          anyOf:
            - type: number
            - type: string
            - type: boolean
          title: Value
      additionalProperties: false
      type: object
      required:
        - source
        - value
      title: _LiteralOperand
    EnumOption:
      properties:
        name:
          type: string
          minLength: 1
          title: Name
        description:
          type: string
          minLength: 1
          title: Description
          description: Free-form description shown to the model.
      additionalProperties: false
      type: object
      required:
        - name
        - description
      title: EnumOption
  securitySchemes:
    ApiKeyAuth:
      type: http
      description: >-
        API key issued from app.anyformat.ai/api-key. Send as `Authorization:
        Bearer <key>`.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.