Skip to Content
Docs are being rebuilt — start at Introduction → How it works.

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

  1. Drag Conditional from Control Flow onto the canvas.
  2. Connect the previous node into the Conditional node.
  3. Select the Conditional node.
  4. Enter a JavaScript expression in Condition (JavaScript).
  5. Connect the true and false handles to different downstream paths.
FieldRequiredWhat it controls
Condition (JavaScript)YesThe expression that decides which output path runs. Use previous inputs such as input1 in the expression.
ConditionEffect
input1.score > 0.8Sends high-scoring items down the true path.
input1.status === 'approved'Continues only when the previous output is approved.
input1?.errorRoutes error payloads into a recovery path.

How to split work with Fork

  1. Drag Fork from Control Flow onto the canvas.
  2. Connect the previous node into the Fork node.
  3. Select the Fork node.
  4. Choose Number of Branches.
  5. Connect each output handle to the branch that should run in parallel.
FieldOptionsWhat it controls
Number of Branches2, 3, 4How 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

  1. Drag Join from Control Flow onto the canvas.
  2. Connect each parallel branch into the Join node.
  3. Select the Join node.
  4. Choose Number of Branches to match the incoming paths.
  5. Choose Merge Strategy.
  6. Connect the Join output to the next node.
FieldOptionsWhat it controls
Number of Branches2, 3, 4How many incoming branches the Join waits for.
Merge StrategyCombine as Array, Merge as Object, Use First Input, Use Last InputHow branch outputs are passed to the next node.

Common patterns

PatternNode sequence
Error recoveryTrigger -> Agent -> Conditional -> recovery path or continue path.
Parallel researchTrigger -> Fork -> several agents -> Join -> summary agent.
First result winsTrigger -> Fork -> multiple data sources -> Join with Use First Input.
Latest override winsTrigger -> Fork -> enrichment steps -> Join with Use Last Input.

Connection rules

Node typeConnection behavior
Regular action nodesUsually one input and one output.
ConditionalOne input and two output paths.
ForkOne input and multiple output paths.
JoinMultiple 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.