Skip to main content
GET
/
v1
/
workflows
/
{workflow_id}
/
tests
/
{test_id}
from retab import Retab

client = Retab()

test = client.workflows.tests.get(
    workflow_id="wf_abc123xyz",
    test_id="wfnodetest_hsLEQiM61ez9Piv147MWk",
)

print(test.assertion.condition)
print(test.schema_drift)
{
  "id": "wfnodetest_hsLEQiM61ez9Piv147MWk",
  "workflow_id": "wf_abc123xyz",
  "target": { "type": "block", "block_id": "block_extract_invoice" },
  "source": {
    "type": "manual",
    "handle_inputs": {
      "input-document-0": { "type": "file", "file_id": "file_invoice_q1" }
    }
  },
  "name": "Q1 invoice total",
  "assertion": {
    "id": "assert_xyz",
    "target": { "output_handle_id": "output-json-0", "path": "total" },
    "condition": { "kind": "equals", "expected": 1234.56 },
    "label": null
  },
  "schema_drift": "fresh",
  "schema_drift_detail": null,
  "validation_status": "valid",
  "validation_issues": [],
  "latest_run_summary": {
    "run_record_id": "wfnodetestrun_abc123",
    "status": "passed",
    "started_at": "2026-05-01T13:55:00Z",
    "completed_at": "2026-05-01T13:55:18Z",
    "duration_ms": 18221,
    "workflow_draft_fingerprint": "ddd95baadce6045f",
    "block_config_fingerprint": "0ff93ddc7cefcb42",
    "assertions_passed": 1,
    "assertions_failed": 0,
    "blocked_assertions": 0
  },
  "latest_passing_run_summary": { "...": "as above" },
  "latest_failing_run_summary": null,
  "created_at": "2026-04-08T14:22:26Z",
  "updated_at": "2026-04-08T14:27:52Z"
}

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.

Fetch a single workflow test by id. The response refreshes the test’s validation_status and schema-drift state against the current workflow draft before returning, so the caller always sees the latest staleness.
from retab import Retab

client = Retab()

test = client.workflows.tests.get(
    workflow_id="wf_abc123xyz",
    test_id="wfnodetest_hsLEQiM61ez9Piv147MWk",
)

print(test.assertion.condition)
print(test.schema_drift)
{
  "id": "wfnodetest_hsLEQiM61ez9Piv147MWk",
  "workflow_id": "wf_abc123xyz",
  "target": { "type": "block", "block_id": "block_extract_invoice" },
  "source": {
    "type": "manual",
    "handle_inputs": {
      "input-document-0": { "type": "file", "file_id": "file_invoice_q1" }
    }
  },
  "name": "Q1 invoice total",
  "assertion": {
    "id": "assert_xyz",
    "target": { "output_handle_id": "output-json-0", "path": "total" },
    "condition": { "kind": "equals", "expected": 1234.56 },
    "label": null
  },
  "schema_drift": "fresh",
  "schema_drift_detail": null,
  "validation_status": "valid",
  "validation_issues": [],
  "latest_run_summary": {
    "run_record_id": "wfnodetestrun_abc123",
    "status": "passed",
    "started_at": "2026-05-01T13:55:00Z",
    "completed_at": "2026-05-01T13:55:18Z",
    "duration_ms": 18221,
    "workflow_draft_fingerprint": "ddd95baadce6045f",
    "block_config_fingerprint": "0ff93ddc7cefcb42",
    "assertions_passed": 1,
    "assertions_failed": 0,
    "blocked_assertions": 0
  },
  "latest_passing_run_summary": { "...": "as above" },
  "latest_failing_run_summary": null,
  "created_at": "2026-04-08T14:22:26Z",
  "updated_at": "2026-04-08T14:27:52Z"
}

Authorizations

Api-Key
string
header
required

Path Parameters

workflow_id
string
required
test_id
string
required

Response

Successful Response

id
string
required
workflow_id
string
required
target
WorkflowTestBlockTarget · object
required

Public workflow-test target.

The storage layer remains block-scoped today, but the API shape names the tested entity explicitly so workflow-level targets can be added later.

source
ManualWorkflowTestSource · object
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
name
string | null
assertion
AssertionSpec · object

Block-test assertion against one declared output handle.

target is the only supported shape: an output handle id and an optional relative path inside that handle's payload.

assertion_schema_dep
AssertionSchemaDep · object

Single-rule schema dependency for Level 2 drift detection.

assertion_drift_status
enum<string> | null
Available options:
valid,
drifted,
broken
schema_drift
enum<string>
default:unknown
Available options:
none,
partial,
drifted,
unknown
schema_drift_detail
string | null
validation_status
string
default:valid
validation_issues
any[]
latest_run_summary
LatestBlockTestRunSummary · object
latest_passing_run_summary
LatestBlockTestRunSummary · object
latest_failing_run_summary
LatestBlockTestRunSummary · object