Conditional logic
Use control-flow nodes when a workflow should branch, run paths in parallel, or merge parallel results before continuing.
What you can do here
- Route a workflow down true and false paths.
- Split work into two, three, or four parallel branches.
- Join parallel branches back into one downstream path.
- Choose how joined data is merged before the next node runs.
How to branch with Conditional
- Drag Conditional from Control Flow onto the canvas.
- Connect the previous node into the Conditional node.
- Select the Conditional node.
- Enter a JavaScript expression in Condition (JavaScript).
- Connect the true and false handles to different downstream paths.
| Field | Required | What it controls |
|---|---|---|
| Condition (JavaScript) | Yes | The expression that decides which output path runs. Use previous inputs such as input1 in the expression. |
| Condition | Effect |
|---|---|
input1.score > 0.8 | Sends high-scoring items down the true path. |
input1.status === 'approved' | Continues only when the previous output is approved. |
input1?.error | Routes error payloads into a recovery path. |
How to split work with Fork
- Drag Fork from Control Flow onto the canvas.
- Connect the previous node into the Fork node.
- Select the Fork node.
- Choose Number of Branches.
- Connect each output handle to the branch that should run in parallel.
| Field | Options | What it controls |
|---|---|---|
| Number of Branches | 2, 3, 4 | How many parallel paths the Fork node creates. |
Use Fork when independent work can run at the same time, such as calling multiple agents or fetching data from multiple systems.
How to merge work with Join
- Drag Join from Control Flow onto the canvas.
- Connect each parallel branch into the Join node.
- Select the Join node.
- Choose Number of Branches to match the incoming paths.
- Choose Merge Strategy.
- Connect the Join output to the next node.
| Field | Options | What it controls |
|---|---|---|
| Number of Branches | 2, 3, 4 | How many incoming branches the Join waits for. |
| Merge Strategy | Combine as Array, Merge as Object, Use First Input, Use Last Input | How branch outputs are passed to the next node. |
Common patterns
| Pattern | Node sequence |
|---|---|
| Error recovery | Trigger -> Agent -> Conditional -> recovery path or continue path. |
| Parallel research | Trigger -> Fork -> several agents -> Join -> summary agent. |
| First result wins | Trigger -> Fork -> multiple data sources -> Join with Use First Input. |
| Latest override wins | Trigger -> Fork -> enrichment steps -> Join with Use Last Input. |
Connection rules
| Node type | Connection behavior |
|---|---|
| Regular action nodes | Usually one input and one output. |
| Conditional | One input and two output paths. |
| Fork | One input and multiple output paths. |
| Join | Multiple input paths and one output. |
If the builder warns that a node can only have one outgoing connection, use Fork or Conditional. If it warns that a node can only have one incoming connection, use Join.