Skip to main content
POST
/
v1
/
workflows
/
{workflow_id}
/
edges
/
batch
from retab import Retab

client = Retab()

edges = client.workflows.edges.create_batch(
    workflow_id="wf_abc123xyz",
    edges=[
        {
            "id": "edge-start-to-extract",
            "source_block": "start-1",
            "target_block": "extract-1",
            "source_handle": "output-file-0",
            "target_handle": "input-file-0",
        },
        {
            "id": "edge-extract-to-hil",
            "source_block": "extract-1",
            "target_block": "hil-1",
            "source_handle": "output-json-0",
            "target_handle": "input-json-0",
        },
    ],
)

for edge in edges:
    print(edge.id)
[
  {
    "id": "edge-start-to-extract",
    "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-05-01T14:30:00Z"
  },
  {
    "id": "edge-extract-to-hil",
    "workflow_id": "wf_abc123xyz",
    "organization_id": "org_123",
    "draft_version": "draft_v3",
    "source_block": "extract-1",
    "target_block": "hil-1",
    "source_handle": "output-json-0",
    "target_handle": "input-json-0",
    "updated_at": "2026-05-01T14:30:00Z"
  }
]

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.

Create multiple edges in a single request. Pair this with Create Blocks (batch) to scaffold a whole workflow graph in two calls. Each entry has the same shape as the body of Create Edge. The whole batch is rejected if any entry is invalid (duplicate edge ID, missing source/target block, …).
from retab import Retab

client = Retab()

edges = client.workflows.edges.create_batch(
    workflow_id="wf_abc123xyz",
    edges=[
        {
            "id": "edge-start-to-extract",
            "source_block": "start-1",
            "target_block": "extract-1",
            "source_handle": "output-file-0",
            "target_handle": "input-file-0",
        },
        {
            "id": "edge-extract-to-hil",
            "source_block": "extract-1",
            "target_block": "hil-1",
            "source_handle": "output-json-0",
            "target_handle": "input-json-0",
        },
    ],
)

for edge in edges:
    print(edge.id)
[
  {
    "id": "edge-start-to-extract",
    "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-05-01T14:30:00Z"
  },
  {
    "id": "edge-extract-to-hil",
    "workflow_id": "wf_abc123xyz",
    "organization_id": "org_123",
    "draft_version": "draft_v3",
    "source_block": "extract-1",
    "target_block": "hil-1",
    "source_handle": "output-json-0",
    "target_handle": "input-json-0",
    "updated_at": "2026-05-01T14:30:00Z"
  }
]

Authorizations

Api-Key
string
header
required

Path Parameters

workflow_id
string
required

Query Parameters

access_token
string | null

Body

application/json
id
string
required

Client-provided edge ID

source_block
string
required

Source block ID

target_block
string
required

Target block ID

source_handle
string | null

Output handle

target_handle
string | null

Input handle

Response

Successful Response

workflow_id
string
required

Foreign key to workflow

organization_id
string
required

Organization ID for data isolation

source_block
string
required

ID of the source block

target_block
string
required

ID of the target block

id
string
draft_version
string | null

Draft version for live entities

source_handle
string | null

Output handle on source block

target_handle
string | null

Input handle on target block

updated_at
string<date-time>