Skip to navigation

Branch on a Value

View as Markdown

Sometimes a run should do one thing when a value looks a certain way and something else otherwise, such as only enrolling approved leads or routing high scores to a different step. You evaluate the condition, then route on it.

Nodes involved

  • Check evaluates conditions in order and returns one label: the outcome of the first match, or the default outcome.
  • Conditional sends the run down one path or another by comparing that label.

How to build it

1

Evaluate the condition

Add a Check step. Pair each condition with the label it should return. For example, when an earlier step reported an approved status, return APPROVED, and set the default outcome to DECLINED.

The condition reads an earlier step’s output. The value Check returns is the label, not a boolean.

2

Route on the result

Add a Conditional step after the Check. Compare the label, for example Decision is APPROVED, and send the run down the matching path. Build one set of steps for the approved case and another for everything else.

Keep the condition simple and readable. If you find yourself testing several things at once, it is often clearer to use more than one Check.