> ## 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 Experiment Run Result

> Retrieve a single experiment result.

Identified by `result_id`. Returns the per-document result with its
lifecycle status, timing, and produced artifact. Returns 404 if no result
with that ID exists.

Fetch one experiment result by its opaque `result_id`. Use this to refresh a
single document result without re-listing every result for the parent
experiment run.

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

  client = Retab()

  result = client.workflows.experiments.results.get("expresult_1")

  print(result.document_id)
  print(result.lifecycle.status)
  print(result.artifact)
  ```

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

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

  const result = await client.workflows.experiments.results.get("expresult_1");
  console.log(result.documentId);
  console.log(result.lifecycle.status);
  console.log(result.artifact);
  ```

  ```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() {
  	ctx := context.Background()

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

  	result, err := client.Workflows.Experiments.Results.Get(ctx, "expresult_1")
  	if err != nil {
  		log.Fatal(err)
  	}

  	fmt.Println(result.DocumentID)
  	fmt.Println(result.Lifecycle.Status())
  	fmt.Println(result.Artifact)
  }
  ```

  ```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 result = client
          .workflows().experiments().results()
          .get("expresult_1")
          .await?;
      println!("{}", result.document_id);
      println!("{:?}", result.lifecycle);
      println!("{:?}", result.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()->experiments()->results()->get(
      resultId: 'result_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.Experiments.Results.GetAsync("result_abc123");
  Console.WriteLine(result);
  ```

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

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

  result = client.workflows.experiments.results.get(result_id: 'result_abc123')
  puts 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().experiments().results().get("result_abc123");
      System.out.println(result);
    }
  }
  ```

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "expresult_1",
    "run_id": "exprun_2",
    "experiment_id": "exp_abc",
    "document_id": "expdoc_xyz",
    "block_kind": "extract",
    "lifecycle": { "status": "completed" },
    "timing": {
      "started_at": "2026-05-02T11:00:01Z",
      "completed_at": "2026-05-02T11:00:05Z",
      "duration_ms": 4120
    },
    "handle_inputs": {
      "input-document-0": { "type": "file", "filename": "invoice_q1.pdf" }
    },
    "artifact": { "operation": "extraction", "id": "ext_xyz" },
    "attempt": 0
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Experiment result not found: expresult_1"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /v1/workflows/experiments/results/{result_id}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.retab.com
security: []
paths:
  /v1/workflows/experiments/results/{result_id}:
    get:
      tags:
        - Workflows
        - Workflow Experiments
      summary: Get Experiment Result
      description: >-
        Retrieve a single experiment result.


        Identified by `result_id`. Returns the per-document result with its

        lifecycle status, timing, and produced artifact. Returns 404 if no
        result

        with that ID exists.
      operationId: get_experiment_result
      parameters:
        - in: path
          name: result_id
          required: true
          schema:
            type: string
            title: Result Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkflowExperimentResult'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    WorkflowExperimentResult:
      properties:
        id:
          type: string
          title: Id
        experiment_run_id:
          type: string
          title: Experiment Run Id
        experiment_id:
          type: string
          title: Experiment Id
        document_id:
          type: string
          title: Document Id
        lifecycle:
          oneOf:
            - $ref: '#/components/schemas/PendingWorkflowExperimentResult'
            - $ref: '#/components/schemas/QueuedWorkflowExperimentResult'
            - $ref: '#/components/schemas/RunningWorkflowExperimentResult'
            - $ref: '#/components/schemas/CompletedWorkflowExperimentResult'
            - $ref: '#/components/schemas/ErrorWorkflowExperimentResult'
            - $ref: '#/components/schemas/CancelledWorkflowExperimentResult'
          title: Lifecycle
          discriminator:
            propertyName: status
            mapping:
              cancelled:
                $ref: '#/components/schemas/CancelledWorkflowExperimentResult'
              completed:
                $ref: '#/components/schemas/CompletedWorkflowExperimentResult'
              error:
                $ref: '#/components/schemas/ErrorWorkflowExperimentResult'
              pending:
                $ref: '#/components/schemas/PendingWorkflowExperimentResult'
              queued:
                $ref: '#/components/schemas/QueuedWorkflowExperimentResult'
              running:
                $ref: '#/components/schemas/RunningWorkflowExperimentResult'
        timing:
          $ref: '#/components/schemas/ExperimentResultTiming'
        block_type:
          type: string
          enum:
            - extract
            - classifier
            - split
            - for_each
          title: Block Type
        handle_inputs:
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/JsonHandleInput'
              - $ref: '#/components/schemas/FileHandleInput'
            discriminator:
              propertyName: type
              mapping:
                file:
                  $ref: '#/components/schemas/FileHandleInput'
                json:
                  $ref: '#/components/schemas/JsonHandleInput'
          type: object
          title: Handle Inputs
          default: {}
        handle_outputs:
          additionalProperties:
            oneOf:
              - $ref: '#/components/schemas/JsonHandleInput'
              - $ref: '#/components/schemas/FileHandleInput'
            discriminator:
              propertyName: type
              mapping:
                file:
                  $ref: '#/components/schemas/FileHandleInput'
                json:
                  $ref: '#/components/schemas/JsonHandleInput'
          type: object
          title: Handle Outputs
          default: {}
        artifact:
          anyOf:
            - $ref: '#/components/schemas/StepArtifactRef'
            - type: 'null'
        attempt:
          type: integer
          title: Attempt
          default: 0
      type: object
      required:
        - block_type
        - document_id
        - experiment_id
        - experiment_run_id
        - id
        - lifecycle
        - timing
      title: WorkflowExperimentResult
      description: >-
        One experiment block execution for a single document, addressed by
        `experiment_run_id` and `document_id`.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          default: []
      type: object
      title: HTTPValidationError
    PendingWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: pending
          title: Status
          default: pending
      type: object
      title: PendingWorkflowExperimentResult
      description: The result row has been created but execution has not started.
    QueuedWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: queued
          title: Status
          default: queued
      type: object
      title: QueuedWorkflowExperimentResult
      description: The result row is enqueued and waiting for a worker.
    RunningWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: running
          title: Status
          default: running
      type: object
      title: RunningWorkflowExperimentResult
      description: The result row is executing.
    CompletedWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: completed
          title: Status
          default: completed
      type: object
      title: CompletedWorkflowExperimentResult
      description: The result row finished successfully.
    ErrorWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: error
          title: Status
          default: error
        message:
          type: string
          title: Message
          description: Human-readable error message
          default: (no message)
        details:
          anyOf:
            - $ref: '#/components/schemas/ErrorDetails'
            - type: 'null'
          description: Structured error context including stack trace
      type: object
      title: ErrorWorkflowExperimentResult
      description: The result row failed. Per-job error message is bundled into lifecycle.
    CancelledWorkflowExperimentResult:
      properties:
        status:
          type: string
          const: cancelled
          title: Status
          default: cancelled
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: Human-readable reason, when known
      type: object
      title: CancelledWorkflowExperimentResult
      description: >-
        The result row was cancelled (typically propagated from a cancelled
        run).
    ExperimentResultTiming:
      properties:
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        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
        duration_ms:
          anyOf:
            - type: integer
            - type: 'null'
          title: Duration Ms
      type: object
      title: ExperimentResultTiming
    JsonHandleInput:
      properties:
        type:
          type: string
          const: json
          title: Type
          default: json
        data:
          title: Data
          default: null
      additionalProperties: false
      type: object
      title: JsonHandleInput
      description: JSON payload for a handle input. `data` is the raw JSON value.
    FileHandleInput:
      properties:
        type:
          type: string
          const: file
          title: Type
          default: file
        document:
          $ref: '#/components/schemas/ResultFileRef'
      additionalProperties: false
      type: object
      required:
        - document
      title: FileHandleInput
      description: File reference for a handle input.
    StepArtifactRef:
      properties:
        operation:
          type: string
          enum:
            - extraction
            - split
            - classification
            - parse
            - edit
            - partition
            - conditional_evaluation
            - review_trigger_evaluation
            - while_loop_termination
            - api_call_invocation
            - function_invocation
          title: Operation
          description: The kind of resource this artifact references
        id:
          type: string
          title: Id
          description: Resource identifier
      type: object
      required:
        - id
        - operation
      title: StepArtifactRef
      description: >-
        A resource produced by a workflow step.


        An `(operation, id)` reference. The artifact itself carries no payload —

        consumers dispatch on `operation` and fetch the referenced record by
        `id`.
    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
    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.
    ResultFileRef:
      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: ResultFileRef
      description: Public/shared file reference used across SDK and customer-facing APIs.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````