Skip to content

Edges

Edges connect nodes in the flow graph. Each edge has a source and target node.

{
"id": "edge-1",
"source": "start-1",
"target": "agent-1",
"sourceHandle": null,
"targetHandle": null
}
FieldTypeDescription
idstringUnique edge identifier
sourcestringSource node ID
targetstringTarget node ID
sourceHandlestringSource output handle (for branching nodes)
targetHandlestringTarget input handle

Edges can carry conditions and labels:

{
"id": "edge-2",
"source": "if-1",
"target": "agent-positive",
"sourceHandle": "true",
"data": {
"condition": "sentiment === 'positive'",
"label": "Positive"
}
}

Branching nodes use source handles to route edges:

Node TypeHandles
if_elsetrue, false
classifyOne handle per category ID
user_approvalapproved, rejected
guardrailpass, block
whileloop (back to body), done (exit)
{
"style": {
"stroke": "#00CAFF",
"strokeWidth": 2,
"animated": true
}
}
  • Every flow must have a path from start to at least one end node
  • Nodes can have multiple incoming and outgoing edges
  • Circular edges are allowed only through while nodes
  • Edges without a sourceHandle connect from the default output