Choose Execution Paths
How do you choose which steps run? Use Only when to skip one action, If / Else to choose the first matching branch, and Router to run every matching route. Use Join Paths before their shared action.
Start with Invoice intake’s flow contract and configured actions in the development version. Each alternative below reviews an invoice when Amount is over 1000. In the app, open Workflows → Invoice intake → Dev → flow.
Every workflow-scoped tool call below carries an explicit workflowId. Start with workflow_list:
{ "limit": 100 }Choose the exact Invoice intake entry’s data.items[].id as <workflowId>. If names collide, ask which one is meant. Check data.hasMore before concluding it is absent; limit caps at 100.
Read the outline with workflow_outline:
{ "workflowId": "<workflowId>" }From data.flows[].id, note <flowId>. From that flow’s nodes[].id, note <noteNodeId>, <reviewNodeId>, <ordinaryNodeId> and <sharedNodeId> by name. These examples use one action per branch.
Skip one action without stopping its path
Section titled “Skip one action without stopping its path”In the action’s menu, choose Enable skip condition → Only when. A false condition skips that node and leaves its outputs null. Everything downstream stays eligible. To exclude the entire storage path, use branching.
Read the expression context with expr_context before setting a condition. These examples assume flow.amount. If you renamed the input, substitute the binding that context advertises throughout.
{ "workflowId": "<workflowId>", "nodeId": "<noteNodeId>" }Then set the condition with node_only_when_set:
{ "workflowId": "<workflowId>", "nodeId": "<noteNodeId>", "js": "flow.amount > 1000" }Scalar conditions reject && and ||. In a compound rule, entries in a row are joined with AND, and rows are joined with OR. This replacement passes parsed groups to node_only_when_set and limits the note to amounts above 1000 and below 2000:
{ "workflowId": "<workflowId>", "nodeId": "<noteNodeId>", "groups": [["flow.amount > 1000", "flow.amount < 2000"]] }Branch tools take the same row shape as parsed conditionJson.
Choose one branch and configure its fallback
Section titled “Choose one branch and configure its fallback”Choose Add action, search Actions for If / Else, then edit the initial If’s When. A new If is blank, and a blank If fails execution validation. Else must be unique, last and condition-free. Add branch adds conditions. Move up and Move down change first-match priority.
Find each control before adding it with integration_action_list, once per query ("If / Else", "Router", "Join Paths", "Wait"):
{ "query": "If / Else" }For each matching data.items entry, note nodeSlug and key as its named placeholders below. Inspect If / Else with integration_action_get:
{ "integration": "<ifSlug>", "key": "<ifComponentKey>" }Then add it with node_add:
{ "workflowId": "<workflowId>", "flow": "<flowId>", "node": "<ifSlug>", "key": "<ifComponentKey>", "name": "Choose invoice review" }Note data.nodeId as <ifNodeId>, then read its branches and bindings with branch_list and expr_context, each called with:
{ "workflowId": "<workflowId>", "nodeId": "<ifNodeId>" }Note the data.items[].id values for If and Else as <ifBranchId> and <elseBranchId>. Update the existing If with branch_update:
{ "workflowId": "<workflowId>", "nodeId": "<ifNodeId>", "branchId": "<ifBranchId>", "name": "Needs review", "js": "flow.amount > 1000" }Then connect both branches with branch_connect, once per branch:
{ "workflowId": "<workflowId>", "nodeId": "<ifNodeId>", "flow": "<flowId>", "branchId": "<ifBranchId>", "to": "<reviewNodeId>" }{ "workflowId": "<workflowId>", "nodeId": "<ifNodeId>", "flow": "<flowId>", "branchId": "<elseBranchId>", "to": "<ordinaryNodeId>" }To reorder conditions, call branch_reorder with an order array holding every condition ID from branch_list, each listed exactly once. Exclude Else:
{ "workflowId": "<workflowId>", "nodeId": "<ifNodeId>", "order": ["<conditionId>", "<conditionId>"] }In the app, draw each branch’s output handle to its action. Ordinary node_connect supports main and Error outputs, not branch IDs. If you connect exclusive branches directly to one ordinary action, that action is blocked whenever either incoming path is untaken.
Run every matching route
Section titled “Run every matching route”When the checks overlap, use Router instead, under Routes → Add new route → When. Routes have no order, so the app has no move controls and branch_reorder rejects Router. Blank Router conditions are true at runtime, and contrary tool warnings are stale. Set each condition explicitly.
Inspect Router with integration_action_get, then add it with node_add:
{ "integration": "<routerSlug>", "key": "<routerComponentKey>" }{ "workflowId": "<workflowId>", "flow": "<flowId>", "node": "<routerSlug>", "key": "<routerComponentKey>", "name": "Check invoice routes" }Note data.nodeId as <routerNodeId>, then read its routes and bindings with branch_list and expr_context, each called with:
{ "workflowId": "<workflowId>", "nodeId": "<routerNodeId>" }Use the initial data.items[].id as <reviewRouteId>, then name that route with branch_update and add a second one with branch_add:
{ "workflowId": "<workflowId>", "nodeId": "<routerNodeId>", "branchId": "<reviewRouteId>", "name": "Needs review", "js": "flow.amount > 1000" }{ "workflowId": "<workflowId>", "nodeId": "<routerNodeId>", "name": "Positive amount", "js": "flow.amount > 0" }Note the add result’s data.id as <positiveRouteId>, then connect both routes with branch_connect:
{ "workflowId": "<workflowId>", "nodeId": "<routerNodeId>", "flow": "<flowId>", "branchId": "<reviewRouteId>", "to": "<reviewNodeId>" }{ "workflowId": "<workflowId>", "nodeId": "<routerNodeId>", "flow": "<flowId>", "branchId": "<positiveRouteId>", "to": "<ordinaryNodeId>" }Join paths before the shared action
Section titled “Join paths before the shared action”Add Join Paths, wire every branch tail into it, and select Mode. It waits for all incoming sources to finish or skip.
| Mode | Active inputs | Result |
|---|---|---|
chooseActivePath |
One | Passes that input’s value. |
chooseActivePath |
Zero | skipped, skipReason: "no_active_path"; downstream is blocked. Enabling Continue execution when no path is active instead completes with null. |
chooseActivePath |
Multiple | Fails. |
passThrough (default) |
Any | One field per input; blocked inputs are null. Use for overlapping routes. |
Inspect Join Paths with integration_action_get, then add it with node_add:
{ "integration": "<joinSlug>", "key": "<joinComponentKey>" }{ "workflowId": "<workflowId>", "flow": "<flowId>", "node": "<joinSlug>", "key": "<joinComponentKey>", "name": "Join invoice paths" }Note data.nodeId as <joinNodeId>. With Router, keep the default passThrough and skip the mode and type writes below, but use the same connections. For exclusive paths, set the mode with node_prop_set:
{ "workflowId": "<workflowId>", "nodeId": "<joinNodeId>", "prop": "mode", "value": "chooseActivePath" }Then read the join’s props with node_prop_list ({ "workflowId": "<workflowId>", "nodeId": "<joinNodeId>" }) and both tails with node_get, once with <reviewNodeId> and once with <ordinaryNodeId>:
{ "workflowId": "<workflowId>", "nodeId": "<reviewNodeId>" }These connections use each tail’s Main output. Select its data.outputs[] entry, excluding Error, and confirm the dataType values agree before you set <pathDataType>. For a join that already exists, inspect its edges first with flow_get:
{ "workflowId": "<workflowId>", "flowId": "<flowId>" }Match each join edge’s data.edges[].sourceHandle (output-<outputId>) to that source’s data.outputs[].id. Use that exact output’s type.
pathDataType has no options list. Every connected input whose type resolves must match, including inactive inputs. Unresolved types escape the check, so resolve dynamic outputs and validate.
Set that type with node_prop_set:
{ "workflowId": "<workflowId>", "nodeId": "<joinNodeId>", "prop": "pathDataType", "value": "<pathDataType>" }Then wire both tails into the join and the join into the shared action with node_connect, once per edge:
{ "workflowId": "<workflowId>", "flow": "<flowId>", "from": "<reviewNodeId>", "output": "main", "to": "<joinNodeId>" }{ "workflowId": "<workflowId>", "flow": "<flowId>", "from": "<ordinaryNodeId>", "output": "main", "to": "<joinNodeId>" }{ "workflowId": "<workflowId>", "flow": "<flowId>", "from": "<joinNodeId>", "to": "<sharedNodeId>" }Delay the shared action
Section titled “Delay the shared action”Add Wait, set Seconds, and wire Join → Wait → shared action. Wait returns true, so keep Join → shared action to preserve its payload. The shared action then waits for both inputs. Wait defaults to 1 second, accepts 0–2,592,000 seconds and uses a durable timer.
Inspect Wait with integration_action_get, then add it after the join with node_add, which takes parsed props:
{ "integration": "<waitSlug>", "key": "<waitComponentKey>" }{ "workflowId": "<workflowId>", "flow": "<flowId>", "node": "<waitSlug>", "key": "<waitComponentKey>", "after": "<joinNodeId>", "props": { "seconds": 30 } }Note data.nodeId as <waitNodeId>, then wire it into the shared action with node_connect:
{ "workflowId": "<workflowId>", "flow": "<flowId>", "from": "<waitNodeId>", "to": "<sharedNodeId>" }Continue on error is unavailable on If / Else, so handle errors on the preceding action. Turning it off on an action deletes Error-output edges and the target inputs they supplied. Inspect those dependents afterwards.
Prove each intended path
Section titled “Prove each intended path”A selected route that is not wired can end in a green run with no intended output. Audit your chosen <controlNodeId> (If / Else or Router) with branch_list, inspect the wiring with flow_layout, fix unwired paths, then call workflow_validate:
{ "workflowId": "<workflowId>", "nodeId": "<controlNodeId>" }{ "workflowId": "<workflowId>", "flowId": "<flowId>" }{ "workflowId": "<workflowId>" }Read the flow’s inputs with run_inputs, which takes the flow ID as nodeIdOrFlowId and flow: true:
{ "workflowId": "<workflowId>", "nodeIdOrFlowId": "<flowId>", "flow": true }From the input result’s data.flowInputs[], note Invoice ID’s id as <invoiceInputId> and the amount input’s id as <amountInputId>. The fixtures use these IDs, so a display-name change does not affect them.
In Dev, choose Test (tooltip: Test current flow), then Run history. Provider actions execute for real, so choose test destinations first.
Run each fixture separately with run_flow. After each run, note data.workflowExecutionId as <workflowExecutionId> and inspect it with execution_tree ({ "workflowId": "<workflowId>", "workflowExecutionId": "<workflowExecutionId>" }) before you continue. A successful response can still describe a failed, paused or timed-out execution, so check data.status and data.finished.
{ "workflowId": "<workflowId>", "flowId": "<flowId>", "target": "dev", "inputs": { "<invoiceInputId>": "INV-104", "<amountInputId>": 120 } }{ "workflowId": "<workflowId>", "flowId": "<flowId>", "target": "dev", "inputs": { "<invoiceInputId>": "INV-104", "<amountInputId>": 1000 } }{ "workflowId": "<workflowId>", "flowId": "<flowId>", "target": "dev", "inputs": { "<invoiceInputId>": "INV-105", "<amountInputId>": 1500 } }{ "workflowId": "<workflowId>", "flowId": "<flowId>", "target": "dev", "inputs": { "<invoiceInputId>": "INV-104", "<amountInputId>": 0 } }Expect Else at 120 and 1000, and Needs review at 1500. With Router, 1500 selects both routes and 0 selects neither. Confirm one shared action after a pass-through join. Distinguish only_when_false, upstream_skipped and no_active_path in run details.