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 a condition and gives you a true-or-false result.
  • Conditional sends the run down one path or another based on that result.

How to build it

1

Evaluate the condition

Add a Check step and write the condition you want to test. For example, to test whether an earlier step reported an approved status:

status == 'APPROVED'

The value on the left is usually a reference to an earlier step’s output.

2

Route on the result

Add a Conditional step after the Check. It reads the true-or-false result and sends the run down the matching path, so you can 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.