Skip to main content
GET
/
v1
/
workflows
/
edges
from retab import Retab

client = Retab()

# All edges
edges = client.workflows.edges.list("wf_abc123xyz")

# Outgoing edges of one block
outgoing = client.workflows.edges.list(
    "wf_abc123xyz",
    source_block="extract-1",
)

# Incoming edges of one block
incoming = client.workflows.edges.list(
    "wf_abc123xyz",
    target_block="extract-1",
)

for edge in edges.data:
    print(f"{edge.source_block}/{edge.source_handle} -> {edge.target_block}/{edge.target_handle}")
{
  "data": [
    {
      "id": "edge-1",
      "workflow_id": "wf_abc123xyz",
      "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"
    }
  ],
  "list_metadata": {
    "before": null,
    "after": null
  }
}
List edges in a workflow’s current draft. Optionally filter to edges incident to a specific block by passing source_block or target_block. Returns the canonical { "data": [...], "list_metadata": { "before": null, "after": null } } pagination envelope shared with all Retab list endpoints. Cursor pagination is not yet implemented for this endpoint — list_metadata is always { before: null, after: null }. Use this endpoint with List Blocks when you need to reconstruct a workflow graph.
from retab import Retab

client = Retab()

# All edges
edges = client.workflows.edges.list("wf_abc123xyz")

# Outgoing edges of one block
outgoing = client.workflows.edges.list(
    "wf_abc123xyz",
    source_block="extract-1",
)

# Incoming edges of one block
incoming = client.workflows.edges.list(
    "wf_abc123xyz",
    target_block="extract-1",
)

for edge in edges.data:
    print(f"{edge.source_block}/{edge.source_handle} -> {edge.target_block}/{edge.target_handle}")
{
  "data": [
    {
      "id": "edge-1",
      "workflow_id": "wf_abc123xyz",
      "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"
    }
  ],
  "list_metadata": {
    "before": null,
    "after": null
  }
}

Authorizations

Api-Key
string
header
required

Query Parameters

workflow_id
string
required
source_block
string | null

Filter by source block ID

target_block
string | null

Filter by target block ID

before
string | null

Edge id cursor: return the page before this id (mutually exclusive with after).

after
string | null

Edge id cursor: return the page after this id (mutually exclusive with before).

limit
integer
default:100

Maximum number of edges to return per page (1-200).

Required range: 1 <= x <= 200

Response

Successful Response

A page of WorkflowEdge resources. data holds the items and list_metadata carries the before/after cursors; pass after to fetch the next page.

data
WorkflowEdge · object[]
required
list_metadata
ListMetadata · object
required

Boundary resource IDs for page navigation.