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

# Get Artifact

> Get one workflow artifact by id.

The artifact kind is derived from the id prefix (`extr_…` → extraction,
`clss_…` → classification, etc.).

Fetch one dereferenced workflow artifact by `artifact_id`. The endpoint infers
the backing artifact operation from the id prefix, so callers do not need to
know which collection stores the record.

The response is the flattened artifact record with `operation` injected at the
top level. Operation-specific fields are preserved.

<RequestExample>
  ```python Python theme={null}
  from retab import Retab

  client = Retab()

  artifact = client.workflows.artifacts.get("ceval_abc123")

  print(artifact.operation)
  print(artifact.id)
  ```

  ```typescript TypeScript theme={null}
  import { Retab } from "@retab/node";

  const client = new Retab({ apiKey: process.env.RETAB_API_KEY });

  const artifact = await client.workflows.artifacts.get("ceval_abc123");
  console.log(artifact.operation);
  console.log(artifact.id);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	retab "github.com/retab-dev/retab/clients/go"
  )

  func ptr[T any](v T) *T { return &v }

  func main() {
  	client, err := retab.NewClient("")
  	if err != nil {
  		log.Fatal(err)
  	}

  	artifact, err := client.Workflows.Artifacts.Get(context.Background(), "ceval_abc123")
  	if err != nil {
  		log.Fatal(err)
  	}

  	fmt.Println(artifact)
  }
  ```

  ```ruby Ruby theme={null}
  require 'retab'

  client = Retab::Client.new(api_key: ENV['RETAB_API_KEY'])

  artifact = client.workflows.artifacts.get(artifact_id: 'ceval_abc123')

  puts artifact['operation']
  puts artifact['id']
  ```

  ```rust Rust theme={null}
  use retab::Retab;

  #[tokio::main]
  async fn main() -> Result<(), Box<dyn std::error::Error>> {
      let client = Retab::new(std::env::var("RETAB_API_KEY")?);

      let artifact = client.workflows().artifacts().get("ceval_abc123").await?;
      println!("{:?}", artifact);
      Ok(())
  }
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  use Retab\Client;

  $client = new Client(apiKey: getenv('RETAB_API_KEY'));

  $result = $client->workflows()->artifacts()->get(
      artifactId: 'artifact_abc123',
  );
  print_r($result);
  ```

  ```csharp C# theme={null}
  using Retab;
  using RetabClient = Retab.Retab;

  var apiKey = Environment.GetEnvironmentVariable("RETAB_API_KEY")!;
  var client = new RetabClient(apiKey);

  var result = await client.Workflows.Artifacts.GetAsync("artifact_abc123");
  Console.WriteLine(result);
  ```

  ```java Java theme={null}
  import com.retab.RetabClient;

  public final class Example {
    public static void main(String[] args) throws Exception {
      RetabClient client = new RetabClient(System.getenv("RETAB_API_KEY"));

      var result = client.workflows().artifacts().get("artifact_abc123");
      System.out.println(result);
    }
  }
  ```

  ```curl cURL theme={null}
  curl -X 'GET' \
    'https://api.retab.com/v1/workflows/artifacts/ceval_abc123' \
    -H 'Authorization: Bearer <your-api-key>'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "operation": "conditional_evaluation",
    "id": "ceval_abc123",
    "run_id": "run_abc123xyz",
    "step_id": "conditional-block-1",
    "selected_handles": ["wrong"],
    "matched_branch_id": "branch_wrong",
    "matched_condition_ids": ["condition_wrong_total"],
    "evaluations": [
      {
        "condition_id": "condition_wrong_total",
        "matched": true,
        "output_handle_id": "wrong",
        "left_value": 1200,
        "operator": "greater_than",
        "right_value": 1000
      }
    ],
    "created_at": "2026-03-12T09:00:04Z"
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Unknown artifact id - prefix does not match any known workflow artifact operation"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/workflows/artifacts/{artifact_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/artifacts/{artifact_id}:
    get:
      tags:
        - Workflows
        - Workflow Artifacts
      summary: Get Workflow Artifact By Id
      description: |-
        Get one workflow artifact by id.

        The artifact kind is derived from the id prefix (`extr_…` → extraction,
        `clss_…` → classification, etc.).
      operationId: get_workflow_artifact_by_id
      parameters:
        - in: path
          name: artifact_id
          required: true
          schema:
            type: string
            title: Artifact Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ExtractionWorkflowArtifact'
                  - $ref: '#/components/schemas/SplitWorkflowArtifact'
                  - $ref: '#/components/schemas/ClassificationWorkflowArtifact'
                  - $ref: '#/components/schemas/ParseWorkflowArtifact'
                  - $ref: '#/components/schemas/EditWorkflowArtifact'
                  - $ref: '#/components/schemas/PartitionWorkflowArtifact'
                  - $ref: '#/components/schemas/ConditionalEvaluationWorkflowArtifact'
                  - $ref: '#/components/schemas/ReviewEvaluationWorkflowArtifact'
                  - $ref: '#/components/schemas/WhileLoopTerminationWorkflowArtifact'
                  - $ref: '#/components/schemas/ApiCallInvocationWorkflowArtifact'
                  - $ref: '#/components/schemas/FunctionInvocationWorkflowArtifact'
                discriminator:
                  propertyName: operation
                  mapping:
                    extraction:
                      $ref: '#/components/schemas/ExtractionWorkflowArtifact'
                    split:
                      $ref: '#/components/schemas/SplitWorkflowArtifact'
                    classification:
                      $ref: '#/components/schemas/ClassificationWorkflowArtifact'
                    parse:
                      $ref: '#/components/schemas/ParseWorkflowArtifact'
                    edit:
                      $ref: '#/components/schemas/EditWorkflowArtifact'
                    partition:
                      $ref: '#/components/schemas/PartitionWorkflowArtifact'
                    conditional_evaluation:
                      $ref: >-
                        #/components/schemas/ConditionalEvaluationWorkflowArtifact
                    review_trigger_evaluation:
                      $ref: '#/components/schemas/ReviewEvaluationWorkflowArtifact'
                    while_loop_termination:
                      $ref: >-
                        #/components/schemas/WhileLoopTerminationWorkflowArtifact
                    api_call_invocation:
                      $ref: '#/components/schemas/ApiCallInvocationWorkflowArtifact'
                    function_invocation:
                      $ref: '#/components/schemas/FunctionInvocationWorkflowArtifact'
                title: >-
                  Response Get Workflow Artifact By Id V1 Workflows Artifacts 
                  Artifact Id  Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    ExtractionWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the extraction
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the extracted file
        model:
          type: string
          title: Model
          description: Model used for the extraction
        json_schema:
          additionalProperties: true
          type: object
          title: Json Schema
          description: JSON schema used for the extraction
        n_consensus:
          type: integer
          title: N Consensus
          description: Number of consensus votes used
          default: 1
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the extraction request.
        output:
          additionalProperties: true
          type: object
          title: Output
          description: The extracted structured data
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        consensus:
          anyOf:
            - $ref: '#/components/schemas/ExtractionConsensus'
            - type: 'null'
          description: Consensus metadata for multi-vote extraction runs
        metadata:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Metadata
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the extraction
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: extraction
          title: Operation
          description: The operation that produced this artifact
          default: extraction
      type: object
      required:
        - file
        - id
        - json_schema
        - model
        - output
      title: ExtractionWorkflowArtifact
      description: >-
        An extraction produced by a workflow run, tagged with its artifact
        `operation` and creation time.
    SplitWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the split result
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the split file
        model:
          type: string
          title: Model
          description: Model used for the split operation
        subdocuments:
          items:
            $ref: '#/components/schemas/Subdocument'
          type: array
          title: Subdocuments
          description: Subdocuments used for the split operation
        n_consensus:
          type: integer
          title: N Consensus
          description: Number of consensus votes used
          default: 1
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the split request.
        output:
          items:
            $ref: '#/components/schemas/SplitResult'
          type: array
          title: Output
          description: >-
            The list of document splits with their assigned pages. Empty []
            until status == 'completed'.
          default: []
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        consensus:
          anyOf:
            - $ref: '#/components/schemas/SplitConsensus'
            - type: 'null'
          description: Consensus metadata for multi-vote split runs
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the split operation
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: split
          title: Operation
          description: The operation that produced this artifact
          default: split
      type: object
      required:
        - created_at
        - file
        - id
        - model
        - subdocuments
      title: SplitWorkflowArtifact
      description: >-
        A document split produced by a workflow run, tagged with its artifact
        `operation` and creation time.
    ClassificationWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the classification
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the classified file
        model:
          type: string
          title: Model
          description: Model used for classification
        categories:
          items:
            $ref: '#/components/schemas/Category'
          type: array
          title: Categories
          description: Categories the document was classified against
        n_consensus:
          type: integer
          title: N Consensus
          description: Number of consensus votes used
          default: 1
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the classification request.
        output:
          $ref: '#/components/schemas/ClassificationDecision'
          description: >-
            The classification result with reasoning. A degenerate empty
            decision until status == 'completed'; gate reads on status.
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        consensus:
          anyOf:
            - $ref: '#/components/schemas/ClassificationConsensus'
            - type: 'null'
          description: Consensus metadata for multi-vote classification runs
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the classification
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: classification
          title: Operation
          description: The operation that produced this artifact
          default: classification
      type: object
      required:
        - categories
        - created_at
        - file
        - id
        - model
      title: ClassificationWorkflowArtifact
      description: >-
        A classification produced by a workflow run, tagged with its artifact
        `operation` and creation time.
    ParseWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the parse
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the parsed file
        model:
          type: string
          title: Model
          description: Model used for parsing
        table_parsing_format:
          type: string
          enum:
            - markdown
            - yaml
            - html
            - json
          title: Table Parsing Format
          description: Format used to render tables extracted from the document
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the parse request.
        output:
          $ref: '#/components/schemas/ParseOutput'
          description: The parsed document content
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the parse operation
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: parse
          title: Operation
          description: The operation that produced this artifact
          default: parse
      type: object
      required:
        - created_at
        - file
        - id
        - model
        - output
        - table_parsing_format
      title: ParseWorkflowArtifact
      description: >-
        A parse produced by a workflow run, tagged with its artifact `operation`
        and creation time.
    EditWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the edit.
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the source file (input document or template PDF).
        model:
          type: string
          title: Model
          description: Model used for the edit operation.
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the edit request.
        config:
          $ref: '#/components/schemas/EditConfig'
          description: Configuration used for the edit operation.
        template_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Template Id
          description: >-
            Template id used when the edit was created from a template; null for
            direct-document edits.
        output:
          $ref: '#/components/schemas/EditResult'
          description: >-
            The edit result: filled form fields and the rendered PDF. An empty
            sentinel until status == 'completed'; gate reads on status.
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        filled_document_ref:
          anyOf:
            - $ref: '#/components/schemas/FileRef'
            - type: 'null'
          description: Durable file reference for the filled document, when materialized.
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the edit operation.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: edit
          title: Operation
          description: The operation that produced this artifact
          default: edit
      type: object
      required:
        - config
        - file
        - id
        - model
      title: EditWorkflowArtifact
      description: >-
        An edit produced by a workflow run, tagged with its artifact `operation`
        and creation time.
    PartitionWorkflowArtifact:
      properties:
        id:
          type: string
          title: Id
          description: Unique identifier of the partition
        file:
          $ref: '#/components/schemas/FileRef'
          description: Information about the partitioned file
        model:
          type: string
          title: Model
          description: Model used for the partition operation
        key:
          type: string
          title: Key
          description: Partition key used for the run
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Free-form instructions supplied with the partition request
        n_consensus:
          type: integer
          title: N Consensus
          description: Number of consensus votes used
          default: 1
        allow_overlap:
          type: boolean
          title: Allow Overlap
          description: >-
            Whether pages were allowed to appear in more than one partition
            chunk
          default: true
        output:
          items:
            $ref: '#/components/schemas/PartitionChunk'
          type: array
          title: Output
          description: >-
            The list of partition chunks with their assigned pages. Empty []
            until status == 'completed'.
          default: []
        status:
          type: string
          enum:
            - pending
            - queued
            - in_progress
            - completed
            - failed
            - cancelled
          title: Status
          description: >-
            Lifecycle status. The synchronous path returns 'completed'.
            Background runs progress pending -> queued -> in_progress ->
            completed | failed | cancelled.
          default: pending
        error:
          anyOf:
            - $ref: '#/components/schemas/PrimitiveError'
            - type: 'null'
          description: >-
            Error details when a background run fails; null otherwise. Always
            present so consumers can read it without an existence check.
        consensus:
          anyOf:
            - $ref: '#/components/schemas/PartitionConsensus'
            - type: 'null'
          description: Consensus metadata for multi-vote partition runs
        usage:
          anyOf:
            - $ref: '#/components/schemas/RetabUsage'
            - type: 'null'
          description: Usage information for the partition operation
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
        operation:
          type: string
          const: partition
          title: Operation
          description: The operation that produced this artifact
          default: partition
      type: object
      required:
        - file
        - id
        - key
        - model
      title: PartitionWorkflowArtifact
      description: >-
        A partition produced by a workflow run, tagged with its artifact
        `operation` and creation time.
    ConditionalEvaluationWorkflowArtifact:
      properties:
        operation:
          type: string
          const: conditional_evaluation
          title: Operation
          description: The operation that produced this artifact
          default: conditional_evaluation
        id:
          type: string
          title: Id
        run_id:
          type: string
          title: Run Id
        step_id:
          type: string
          title: Step Id
        evaluations:
          items:
            $ref: '#/components/schemas/ConditionEvaluationResult'
          type: array
          title: Evaluations
          default: []
        selected_handles:
          items:
            type: string
          type: array
          title: Selected Handles
          default: []
        matched_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Matched Branch Id
        matched_condition_ids:
          items:
            type: string
          type: array
          title: Matched Condition Ids
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
      type: object
      required:
        - id
        - run_id
        - step_id
      title: ConditionalEvaluationWorkflowArtifact
      description: |-
        Record of how a conditional block routed during a workflow run.

        Captures each condition that was evaluated (`evaluations`), which output
        branches were chosen (`selected_handles`), and the branch and condition
        IDs that matched (`matched_branch_id`, `matched_condition_ids`).
    ReviewEvaluationWorkflowArtifact:
      properties:
        operation:
          type: string
          const: review_trigger_evaluation
          title: Operation
          description: The operation that produced this artifact
          default: review_trigger_evaluation
        id:
          type: string
          title: Id
        run_id:
          type: string
          title: Run Id
        step_id:
          type: string
          title: Step Id
        evaluations:
          items:
            $ref: '#/components/schemas/ConditionEvaluationResult'
          type: array
          title: Evaluations
          default: []
        selected_handles:
          items:
            type: string
          type: array
          title: Selected Handles
          default: []
        matched_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Matched Branch Id
        matched_condition_ids:
          items:
            type: string
          type: array
          title: Matched Condition Ids
          default: []
        requires_human_review:
          type: boolean
          title: Requires Human Review
          default: false
        reviewer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Reviewer Id
        review_decision:
          anyOf:
            - type: string
              enum:
                - approved
                - rejected
            - type: 'null'
          title: Review Decision
        review_notes:
          anyOf:
            - type: string
            - type: 'null'
          title: Review Notes
        requested_revision:
          type: boolean
          title: Requested Revision
          default: false
        reviewed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reviewed At
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
      type: object
      required:
        - created_at
        - id
        - run_id
        - step_id
      title: ReviewEvaluationWorkflowArtifact
      description: >-
        Record of a review-gate evaluation during a workflow run.


        Captures the conditions evaluated against the block's output

        (`evaluations`), whether the gate required human review

        (`requires_human_review`), and, once a reviewer acts, the verdict

        (`review_decision`), any notes, whether a revision was requested, and
        the

        reviewer and timestamp.
    WhileLoopTerminationWorkflowArtifact:
      properties:
        operation:
          type: string
          const: while_loop_termination
          title: Operation
          description: The operation that produced this artifact
          default: while_loop_termination
        id:
          type: string
          title: Id
        run_id:
          type: string
          title: Run Id
        step_id:
          type: string
          title: Step Id
        termination_reason:
          type: string
          enum:
            - max_iterations_reached
            - condition_matched
            - error
          title: Termination Reason
          description: Why the while-loop terminated
        evaluations:
          items:
            $ref: '#/components/schemas/ConditionEvaluationResult'
          type: array
          title: Evaluations
          default: []
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
      type: object
      required:
        - created_at
        - id
        - run_id
        - step_id
        - termination_reason
      title: WhileLoopTerminationWorkflowArtifact
      description: >-
        Record of why a while-loop block stopped iterating during a run.


        Reports the `termination_reason` (`max_iterations_reached`,

        `condition_matched`, or `error`) and the termination conditions that
        were

        evaluated on the final iteration (`evaluations`).
    ApiCallInvocationWorkflowArtifact:
      properties:
        operation:
          type: string
          const: api_call_invocation
          title: Operation
          description: The operation that produced this artifact
          default: api_call_invocation
        id:
          type: string
          title: Id
        run_id:
          type: string
          title: Run Id
        step_id:
          type: string
          title: Step Id
        attempts:
          items:
            $ref: '#/components/schemas/ApiCallAttempt'
          type: array
          title: Attempts
          default: []
        error:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetails'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
      type: object
      required:
        - id
        - run_id
        - step_id
      title: ApiCallInvocationWorkflowArtifact
      description: |-
        Record of an API-call block's outbound HTTP request during a run.

        Lists each request `attempts` made (including retries) and any `error`
        if the call ultimately failed.
    FunctionInvocationWorkflowArtifact:
      properties:
        operation:
          type: string
          const: function_invocation
          title: Operation
          description: The operation that produced this artifact
          default: function_invocation
        id:
          type: string
          title: Id
        run_id:
          type: string
          title: Run Id
        step_id:
          type: string
          title: Step Id
        inputs:
          additionalProperties: true
          type: object
          title: Inputs
          default: {}
        output:
          anyOf:
            - {}
            - type: 'null'
          title: Output
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        error:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetails'
            - type: 'null'
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Timestamp when this artifact was created.
      type: object
      required:
        - id
        - run_id
        - step_id
      title: FunctionInvocationWorkflowArtifact
      description: |-
        Record of a function block's execution during a workflow run.

        Captures the `inputs` passed to the function, the `output` it returned,
        how long it ran (`duration_ms`), and any `error` if execution failed.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    FileRef:
      properties:
        id:
          type: string
          title: Id
          description: ID of the file
        filename:
          type: string
          title: Filename
          description: Filename of the file
        mime_type:
          type: string
          title: Mime Type
          description: MIME type of the file
      type: object
      required:
        - filename
        - id
        - mime_type
      title: FileRef
      description: Public/shared file reference used across SDK and customer-facing APIs.
    PrimitiveError:
      properties:
        code:
          type: string
          title: Code
          description: Machine-readable error code.
        message:
          type: string
          title: Message
          description: Human-readable error message.
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: Optional structured error context.
      type: object
      required:
        - code
        - message
      title: PrimitiveError
    ExtractionConsensus:
      properties:
        choices:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Choices
          description: >-
            Alternative extraction vote outputs used to build the consolidated
            result.
          default: []
        likelihoods:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Likelihoods
          description: >-
            Consensus likelihood tree mirroring the extraction output. Scalar
            leaves carry per-value voter-agreement in [0, 1]; list leaves carry
            one entry per matched list item.
      type: object
      title: ExtractionConsensus
    RetabUsage:
      properties:
        credits:
          type: number
          title: Credits
          description: Credits consumed for processing
      type: object
      required:
        - credits
      title: RetabUsage
      description: Usage information for document processing.
    Subdocument:
      properties:
        name:
          type: string
          title: Name
          description: The name of the subdocument
        description:
          type: string
          title: Description
          description: The description of the subdocument
          default: ''
        allow_multiple_instances:
          type: boolean
          title: Allow Multiple Instances
          description: >-
            When true, this subdocument type can appear more than once in the
            document — the split will identify each distinct instance (runs an
            extra vision-based refinement pass).
          default: false
      type: object
      required:
        - name
      title: Subdocument
    SplitResult:
      properties:
        name:
          type: string
          title: Name
          description: The name of the subdocument
        pages:
          items:
            type: integer
          type: array
          title: Pages
          description: The pages of the subdocument (1-indexed)
        regions:
          items:
            $ref: '#/components/schemas/SheetRegion'
          type: array
          title: Regions
          default: []
      type: object
      required:
        - name
        - pages
      title: SplitResult
    SplitConsensus:
      properties:
        likelihoods:
          items:
            $ref: '#/components/schemas/SplitSubdocumentLikelihood'
          type: array
          title: Likelihoods
          description: Consensus likelihood tree mirroring the split output
          default: []
        choices:
          items:
            items:
              $ref: '#/components/schemas/SplitResult'
            type: array
          type: array
          title: Choices
          description: Alternative split vote outputs used to build the consolidated result
          default: []
      type: object
      title: SplitConsensus
    Category:
      properties:
        name:
          type: string
          title: Name
          description: The name of the category
        handle_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Handle Key
          description: Stable machine key used by workflow classifier output handles
        description:
          type: string
          title: Description
          description: The description of the category
          default: ''
      type: object
      required:
        - name
      title: Category
    ClassificationDecision:
      properties:
        reasoning:
          type: string
          title: Reasoning
          description: The reasoning for the classification decision
        category:
          type: string
          title: Category
          description: The category name that the document belongs to
      type: object
      required:
        - category
        - reasoning
      title: ClassificationDecision
    ClassificationConsensus:
      properties:
        choices:
          items:
            $ref: '#/components/schemas/ClassificationDecision'
          type: array
          title: Choices
          description: >-
            Alternative classification vote outputs used to build the
            consolidated result.
          default: []
        likelihoods:
          type: number
          title: Likelihoods
          description: Consensus likelihood score (0.0-1.0) of the winning classification.
          default: 0
      type: object
      title: ClassificationConsensus
    ParseOutput:
      properties:
        pages:
          items:
            type: string
          type: array
          title: Pages
          description: Text content of each page (1-indexed order)
        text:
          type: string
          title: Text
          description: Concatenated text content of the full document
      type: object
      required:
        - pages
        - text
      title: ParseOutput
    EditConfig:
      properties:
        color:
          anyOf:
            - type: string
            - type: 'null'
          title: Color
          description: Hex code of the color to use for the filled text.
          default: '#000080'
      type: object
      title: EditConfig
    EditResult:
      properties:
        form_data:
          items:
            $ref: '#/components/schemas/FormField'
          type: array
          title: Form Data
          description: Filled form fields (positions, descriptions, and filled values).
        filled_document:
          $ref: '#/components/schemas/MIMEData'
          description: PDF with the filled form values rendered in.
      type: object
      required:
        - filled_document
        - form_data
      title: EditResult
    PartitionChunk:
      properties:
        key:
          type: string
          title: Key
          description: The partition key value for this chunk
        pages:
          items:
            type: integer
          type: array
          title: Pages
          description: The pages assigned to this partition chunk (1-indexed)
          default: []
      type: object
      required:
        - key
      title: PartitionChunk
    PartitionConsensus:
      properties:
        choices:
          items:
            items:
              $ref: '#/components/schemas/PartitionChunk'
            type: array
          type: array
          title: Choices
          description: >-
            Alternative partition vote outputs used to build the consolidated
            result.
          default: []
        likelihoods:
          items:
            $ref: '#/components/schemas/PartitionChunkLikelihood'
          type: array
          title: Likelihoods
          description: Consensus likelihoods aligned with the partition output.
          default: []
      type: object
      title: PartitionConsensus
    ConditionEvaluationResult:
      properties:
        condition_id:
          type: string
          title: Condition Id
          description: Unique identifier for this condition
        path:
          type: string
          title: Path
          description: JSON path that was evaluated
          default: ''
        operator:
          type: string
          title: Operator
          description: Comparison operator used
          default: ''
        expected:
          title: Expected
          description: Expected value
          default: null
        actual:
          title: Actual
          description: Actual value found
          default: null
        matched:
          type: boolean
          title: Matched
          description: Whether the condition matched
          default: false
        branch_name:
          type: string
          title: Branch Name
          description: Branch name (always 'exit' for while-loop termination)
          default: exit
        logical_operator:
          anyOf:
            - type: string
              enum:
                - and
                - or
            - type: 'null'
          title: Logical Operator
          description: Logical operator for compound conditions
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConditionEvaluationPerItem'
              type: array
            - type: 'null'
          title: Items
          description: Per-item breakdown for wildcard array conditions
        sub_evaluations:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConditionEvaluationSubCondition'
              type: array
            - type: 'null'
          title: Sub Evaluations
          description: Sub-condition evaluations for compound conditions
        details:
          $ref: '#/components/schemas/ConditionEvaluationDetails'
          description: Nested details object for frontend compatibility
      type: object
      required:
        - condition_id
        - details
      title: ConditionEvaluationResult
      description: |-
        Complete evaluation result for a termination condition.

        This model represents the full evaluation data sent to the frontend
        for displaying in the Exit Trigger Evaluation dialog.

        The frontend expects data at both top-level and nested in 'details'
        for compatibility with the ConditionalEvaluationsTable component.
    ApiCallAttempt:
      properties:
        attempt_number:
          type: integer
          title: Attempt Number
          description: 0-based attempt index
        request_method:
          type: string
          title: Request Method
        request_url:
          type: string
          title: Request Url
        request_headers:
          additionalProperties:
            type: string
          type: object
          title: Request Headers
          default: {}
        request_body:
          anyOf:
            - {}
            - type: 'null'
          title: Request Body
        response_status:
          anyOf:
            - type: integer
            - type: 'null'
          title: Response Status
        response_headers:
          additionalProperties:
            type: string
          type: object
          title: Response Headers
          default: {}
        response_body:
          anyOf:
            - {}
            - type: 'null'
          title: Response Body
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
        error:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetails'
            - type: 'null'
        started_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Started At
        completed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Completed At
      type: object
      required:
        - attempt_number
        - request_method
        - request_url
      title: ApiCallAttempt
      description: One attempt of an api_call (initial + retries).
    ErrorDetails:
      properties:
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: >-
            Human-readable error message. Free-text; the structured fields below
            are the machine-readable counterpart.
        stack_trace:
          anyOf:
            - type: string
            - type: 'null'
          title: Stack Trace
          description: Full stack trace
        block_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Block Id
          description: ID of the block that failed
        block_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Block Name
          description: Name/label of the block that failed
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
          description: Error code if available
        context:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Context
          description: Additional context about the error
      type: object
      title: ErrorDetails
      description: |-
        Detailed error information for debugging.

        Captures stack traces and context about where and why an error occurred.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
          default: null
        ctx:
          type: object
          title: Context
          default: {}
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SheetRegion:
      properties:
        col_end:
          anyOf:
            - type: integer
            - type: 'null'
          title: Col End
        col_start:
          anyOf:
            - type: integer
            - type: 'null'
          title: Col Start
        header_rows:
          items:
            type: integer
          type: array
          title: Header Rows
          default: []
        row_end:
          type: integer
          title: Row End
        row_start:
          type: integer
          title: Row Start
        sheet_index:
          type: integer
          title: Sheet Index
        sheet_name:
          type: string
          title: Sheet Name
      type: object
      required:
        - row_end
        - row_start
        - sheet_index
        - sheet_name
      title: SheetRegion
    SplitSubdocumentLikelihood:
      properties:
        name:
          anyOf:
            - type: number
            - type: 'null'
          title: Name
          description: Confidence that this split label is correct
        pages:
          items:
            type: number
          type: array
          title: Pages
          description: Confidence for each page in the corresponding split.pages array
          default: []
      type: object
      title: SplitSubdocumentLikelihood
    FormField:
      properties:
        bbox:
          $ref: '#/components/schemas/BBox'
          description: Position and size of this field on the page.
        description:
          type: string
          title: Description
          description: >-
            Human-readable description of the field, including label and
            instructions.
        type:
          $ref: '#/components/schemas/FieldType'
          description: 'Type of field. Currently supported: ''text'' and ''checkbox''.'
        key:
          type: string
          title: Key
          description: Stable key identifying the field in the form data.
        value:
          anyOf:
            - type: string
            - type: 'null'
          title: Value
          description: Filled value of the field as text. Null when no filled value is set.
      type: object
      required:
        - bbox
        - description
        - key
        - type
      title: FormField
    MIMEData:
      properties:
        filename:
          type: string
          title: Filename
          description: The filename of the file
          examples:
            - file.pdf
            - image.png
            - data.txt
        url:
          type: string
          title: Url
          description: The URL of the file in base64 format
          examples:
            - data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...
      additionalProperties: false
      type: object
      required:
        - filename
        - url
      title: MIMEData
      description: A file represented by its `filename` and a base64 data `url`.
    PartitionChunkLikelihood:
      properties:
        key:
          anyOf:
            - type: number
            - type: 'null'
          title: Key
          description: Confidence that this partition key value is correct
        pages:
          items:
            type: number
          type: array
          title: Pages
          description: >-
            Confidence for each page in the corresponding partition chunk.pages
            array
          default: []
      type: object
      title: PartitionChunkLikelihood
    ConditionEvaluationPerItem:
      properties:
        index:
          type: integer
          title: Index
          description: Index of this item in the array
        indices:
          items:
            type: integer
          type: array
          title: Indices
          description: >-
            Hierarchical indices for nested arrays (e.g., [0, 2, 1] for
            items[0].subitems[2].field[1])
          default: []
        actual:
          title: Actual
          description: Actual value at this index
          default: null
        matched:
          type: boolean
          title: Matched
          description: Whether this item matched the condition
          default: false
      type: object
      required:
        - index
      title: ConditionEvaluationPerItem
      description: |-
        Per-item evaluation result for wildcard array conditions.

        When a condition path contains .*, each array element is evaluated
        individually with implicit AND logic (all must match).
    ConditionEvaluationSubCondition:
      properties:
        sub_condition_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Sub Condition Id
          description: Identifier for this sub-condition
        path:
          type: string
          title: Path
          description: JSON path that was evaluated
          default: ''
        operator:
          type: string
          title: Operator
          description: Comparison operator used
          default: ''
        expected:
          title: Expected
          description: Expected value
          default: null
        actual:
          title: Actual
          description: Actual value found
          default: null
        matched:
          type: boolean
          title: Matched
          description: Whether this sub-condition matched
          default: false
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConditionEvaluationPerItem'
              type: array
            - type: 'null'
          title: Items
          description: Per-item breakdown if this sub-condition used a wildcard path
      type: object
      title: ConditionEvaluationSubCondition
      description: |-
        Evaluation result for a sub-condition in a compound condition.

        Used when multiple conditions are combined with AND/OR operators.
    ConditionEvaluationDetails:
      properties:
        path:
          type: string
          title: Path
          description: JSON path that was evaluated
          default: ''
        operator:
          type: string
          title: Operator
          description: Comparison operator used
          default: ''
        expected:
          title: Expected
          description: Expected value
          default: null
        actual:
          title: Actual
          description: Actual value found
          default: null
        matched:
          type: boolean
          title: Matched
          description: Whether the condition matched
          default: false
        items:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConditionEvaluationPerItem'
              type: array
            - type: 'null'
          title: Items
          description: Per-item breakdown for wildcard array conditions
        sub_conditions:
          anyOf:
            - items:
                $ref: '#/components/schemas/ConditionEvaluationSubCondition'
              type: array
            - type: 'null'
          title: Sub Conditions
          description: Sub-condition evaluations for compound conditions
        logical_operator:
          anyOf:
            - type: string
              enum:
                - and
                - or
            - type: 'null'
          title: Logical Operator
          description: Logical operator combining sub-conditions
      type: object
      title: ConditionEvaluationDetails
      description: |-
        Detailed evaluation information for frontend display.

        The frontend reads evaluation data from this nested 'details' object
        for compatibility with the ConditionalEvaluationsTable component.
    BBox:
      properties:
        left:
          type: number
          title: Left
          description: >-
            Left coordinate of the bounding box, relative to page width (0.0 =
            left edge, 1.0 = right edge).
        top:
          type: number
          title: Top
          description: >-
            Top coordinate of the bounding box, relative to page height (0.0 =
            top edge, 1.0 = bottom edge).
        width:
          type: number
          title: Width
          description: Width of the bounding box, relative to page width (0.0–1.0).
        height:
          type: number
          title: Height
          description: Height of the bounding box, relative to page height (0.0–1.0).
        page:
          type: integer
          title: Page
          description: 1-based index of the page where this field appears.
      type: object
      required:
        - height
        - left
        - page
        - top
        - width
      title: BBox
    FieldType:
      type: string
      enum:
        - text
        - checkbox
      title: FieldType
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````