Skip to main content
GET
/
v1
/
workflows
/
runs
/
{run_id}
from retab import Retab

client = Retab()

run = client.workflows.runs.get("run_abc123xyz")

print(f"Lifecycle: {run.lifecycle.status}")
if run.lifecycle.status == "completed":
    if run.timing.started_at and run.timing.completed_at:
        duration_ms = int((run.timing.completed_at - run.timing.started_at).total_seconds() * 1000)
        print(f"Duration: {duration_ms}ms")
    for step_summary in client.workflows.steps.list(run.id):
        step = client.workflows.steps.get(step_summary.step_id)
        if step.handle_outputs:
            print(f"{step.block_id}: {step.handle_outputs}")
{
  "id": "run_abc123xyz",
  "workflow": {
    "workflow_id": "wf_abc123xyz",
    "version_id": "ver_abc123xyz"
  },
  "trigger": { "type": "api" },
  "lifecycle": { "status": "completed" },
  "timing": {
    "created_at": "2024-01-15T10:30:00Z",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:15Z"
  },
  "inputs": {
    "documents": {
      "start_document-block-1": {
        "id": "file_123",
        "filename": "invoice.pdf",
        "mime_type": "application/pdf"
      }
    },
    "json_data": {}
  }
}

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 a single workflow run by ID. Use this endpoint to check lifecycle.status for a running workflow or retrieve the results of a completed workflow. Run timing includes timestamps, not precomputed duration fields. Derive duration from timing.completed_at - timing.started_at when both timestamps are present. Run responses do not embed step records. Use List Steps for per-block status and started_at / completed_at, and use Get Step for typed handle inputs and outputs. For persisted step records such as review-trigger evaluations, function invocations, or API call traces, use List Artifacts.
from retab import Retab

client = Retab()

run = client.workflows.runs.get("run_abc123xyz")

print(f"Lifecycle: {run.lifecycle.status}")
if run.lifecycle.status == "completed":
    if run.timing.started_at and run.timing.completed_at:
        duration_ms = int((run.timing.completed_at - run.timing.started_at).total_seconds() * 1000)
        print(f"Duration: {duration_ms}ms")
    for step_summary in client.workflows.steps.list(run.id):
        step = client.workflows.steps.get(step_summary.step_id)
        if step.handle_outputs:
            print(f"{step.block_id}: {step.handle_outputs}")
{
  "id": "run_abc123xyz",
  "workflow": {
    "workflow_id": "wf_abc123xyz",
    "version_id": "ver_abc123xyz"
  },
  "trigger": { "type": "api" },
  "lifecycle": { "status": "completed" },
  "timing": {
    "created_at": "2024-01-15T10:30:00Z",
    "started_at": "2024-01-15T10:30:00Z",
    "completed_at": "2024-01-15T10:30:15Z"
  },
  "inputs": {
    "documents": {
      "start_document-block-1": {
        "id": "file_123",
        "filename": "invoice.pdf",
        "mime_type": "application/pdf"
      }
    },
    "json_data": {}
  }
}

Authorizations

Api-Key
string
header
required

Path Parameters

run_id
string
required

Response

Successful Response

A single execution of a workflow.

id
string
required

Unique ID for this run

workflow_id
string
required

ID of the workflow that was run

workflow_version_id
string
required

Content-addressed workflow version used for this run.

trigger
TriggerInfo · object
required

What started this run

lifecycle
PendingRun · object
required

The run has been created but execution has not started.

timing
RunTiming · object
required

All timing information

inputs
RunInputs · object

Input payloads supplied at run creation time