Conditional Branching
Gateway nodes let you route workflow execution based on conditions — like if/else or switch/case logic.
How Gateways Work
Section titled “How Gateways Work”A gateway node has:
- Input ports that receive data
- A default output port
- Branch output ports that you define
Each branch has a label and maps to a separate output port. Your backend decides which branch to activate during execution.
Defining a Gateway Node
Section titled “Defining a Gateway Node”{ "id": "intent_router", "name": "Intent Router", "type": "gateway", "category": "logic", "icon": "mdi:directions-fork", "inputs": [ { "id": "input", "name": "Input", "type": "input", "dataType": "string" }, { "id": "metadata", "name": "Metadata", "type": "input", "dataType": "json" } ], "outputs": [{ "id": "default", "name": "Default", "type": "output", "dataType": "string" }], "configSchema": { "type": "object", "properties": { "condition_field": { "type": "string", "title": "Condition Field", "description": "JSON path to the field used for routing" } } }}Adding Branches in the Editor
Section titled “Adding Branches in the Editor”When a user clicks on a gateway node, the configuration panel shows a Branches section:
- Click Add Branch
- Enter a branch label (e.g., “Yes”, “No”, or “Question”, “Task”)
- Each branch creates a new output port on the gateway node
- Connect each branch output to the appropriate downstream node
If/Else Pattern
Section titled “If/Else Pattern”For simple true/false routing:
┌─ "Yes" ─▸ [Process][Check Condition] ──┤ └─ "No" ─▸ [Skip]Define two branches: “Yes” and “No”. Your backend evaluates the condition and activates the matching branch.
Switch/Case Pattern
Section titled “Switch/Case Pattern”For multi-way routing:
┌─ "Email" ─▸ [Send Email][Detect Channel] ──────┤── "Slack" ─▸ [Post to Slack] ├─ "Webhook" ─▸ [Call Webhook] └─ "Default" ─▸ [Log Event]Add as many branches as you need. The default output handles unmatched cases.
Backend Implementation
Section titled “Backend Implementation”Your backend decides which branch to activate. The workflow JSON stores branches in the node’s data:
{ "id": "node-3", "type": "gateway", "data": { "label": "Intent Router", "branches": [ { "id": "question", "label": "Question" }, { "id": "task", "label": "Task" } ] }}Edges connect from branch-specific output ports:
{ "source": "node-3", "sourceHandle": "node-3-output-question", "target": "node-4", "targetHandle": "node-4-input-input"}Connection Validation
Section titled “Connection Validation”Gateway branch outputs use the same data type as the gateway’s input. FlowDrop validates that downstream nodes have compatible input ports.
Next Steps
Section titled “Next Steps”- Node Types — all 7 built-in node types including gateway
- Edge Structure — how edges reference branch ports
- AI Agent Workflow — full example using gateway routing