from retab import Retab
client = Retab()
graph = client.workflows.get_entities("wf_abc123xyz")
print(graph.workflow.name)
print(f"{len(graph.blocks)} blocks, {len(graph.edges)} edges")
for block in graph.start_blocks:
print(f"document input: {block.id}")
for block in graph.start_json_blocks:
print(f"json input: {block.id}")
{
"workflow": {
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"organization_id": "org_123",
"published": {
"snapshot_id": "snap_v2_def456",
"published_at": "2026-04-30T18:00:00Z"
},
"email_trigger": {
"allowed_senders": [],
"allowed_domains": ["acme.com"]
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
},
"blocks": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "start",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"json_schema": {
"type": "object",
"properties": {
"invoice_number": {"type": "string"},
"total": {"type": "number"},
"vendor": {
"type": "object",
"properties": {"name": {"type": "string"}}
}
}
},
"model": "gpt-5"
},
"parent_id": null,
"resolved_schemas": {
"input_schemas": {},
"output_schemas": {
"output-json-0": {"type": "object"}
}
},
"updated_at": "2026-05-01T14:30:00Z"
}
],
"edges": [
{
"id": "edge-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"source_block": "start-1",
"target_block": "extract-1",
"source_handle": "output-file-0",
"target_handle": "input-file-0",
"updated_at": "2026-04-30T17:00:00Z"
}
]
}
Get a workflow with all its entities from separate collections.
This assembles the workflow with blocks and edges from their respective collections. Use this for the workflow builder to display the current draft state.
from retab import Retab
client = Retab()
graph = client.workflows.get_entities("wf_abc123xyz")
print(graph.workflow.name)
print(f"{len(graph.blocks)} blocks, {len(graph.edges)} edges")
for block in graph.start_blocks:
print(f"document input: {block.id}")
for block in graph.start_json_blocks:
print(f"json input: {block.id}")
{
"workflow": {
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"organization_id": "org_123",
"published": {
"snapshot_id": "snap_v2_def456",
"published_at": "2026-04-30T18:00:00Z"
},
"email_trigger": {
"allowed_senders": [],
"allowed_domains": ["acme.com"]
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
},
"blocks": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "start",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"json_schema": {
"type": "object",
"properties": {
"invoice_number": {"type": "string"},
"total": {"type": "number"},
"vendor": {
"type": "object",
"properties": {"name": {"type": "string"}}
}
}
},
"model": "gpt-5"
},
"parent_id": null,
"resolved_schemas": {
"input_schemas": {},
"output_schemas": {
"output-json-0": {"type": "object"}
}
},
"updated_at": "2026-05-01T14:30:00Z"
}
],
"edges": [
{
"id": "edge-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"source_block": "start-1",
"target_block": "extract-1",
"source_handle": "output-file-0",
"target_handle": "input-file-0",
"updated_at": "2026-04-30T17:00:00Z"
}
]
}
Fetch a workflow together with its full graph: every block and edge in the current draft. This is the easiest way to discover the IDs you need for other endpoints — most importantly, theDocumentation Index
Fetch the complete documentation index at: https://docs.retab.com/llms.txt
Use this file to discover all available pages before exploring further.
start and start_json block IDs you must pass to Run Workflow.
The Python SDK exposes two convenience properties on the response:
start_blocks — document-input blocks (type == "start")start_json_blocks — JSON-input blocks (type == "start_json")from retab import Retab
client = Retab()
graph = client.workflows.get_entities("wf_abc123xyz")
print(graph.workflow.name)
print(f"{len(graph.blocks)} blocks, {len(graph.edges)} edges")
for block in graph.start_blocks:
print(f"document input: {block.id}")
for block in graph.start_json_blocks:
print(f"json input: {block.id}")
{
"workflow": {
"id": "wf_abc123xyz",
"name": "Invoice Processing",
"description": "Extract invoice fields and route for review",
"organization_id": "org_123",
"published": {
"snapshot_id": "snap_v2_def456",
"published_at": "2026-04-30T18:00:00Z"
},
"email_trigger": {
"allowed_senders": [],
"allowed_domains": ["acme.com"]
},
"created_at": "2026-04-30T17:00:00Z",
"updated_at": "2026-05-01T14:30:00Z"
},
"blocks": [
{
"id": "start-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "start",
"label": "Invoice Input",
"position_x": 0,
"position_y": 0,
"width": 240,
"height": 120,
"config": null,
"parent_id": null,
"updated_at": "2026-04-30T17:00:00Z"
},
{
"id": "extract-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"type": "extract",
"label": "Extract Invoice Fields",
"position_x": 320,
"position_y": 0,
"width": 240,
"height": 120,
"config": {
"json_schema": {
"type": "object",
"properties": {
"invoice_number": {"type": "string"},
"total": {"type": "number"},
"vendor": {
"type": "object",
"properties": {"name": {"type": "string"}}
}
}
},
"model": "gpt-5"
},
"parent_id": null,
"resolved_schemas": {
"input_schemas": {},
"output_schemas": {
"output-json-0": {"type": "object"}
}
},
"updated_at": "2026-05-01T14:30:00Z"
}
],
"edges": [
{
"id": "edge-1",
"workflow_id": "wf_abc123xyz",
"organization_id": "org_123",
"draft_version": "draft_v3",
"source_block": "start-1",
"target_block": "extract-1",
"source_handle": "output-file-0",
"target_handle": "input-file-0",
"updated_at": "2026-04-30T17:00:00Z"
}
]
}
Successful Response