Decision: choose one route
Goal
Route to one of two blocks based on an earlier value, then rejoin. Time: 15 minutes.
Rules
- Termorq evaluates branches in order, and the first true
whenwins. else: trueis the required fallback.gotonames a block ID. Blocks that aren’t chosen are marked Skipped.- Set
thenon each branch block so the routes converge. Without it,has_textwould carry on toempty_text, because that’s next in file order. - A shared continuation must not require outputs from both branches, because one of them didn’t run.
Condition language
Conditions compare workflow values. They’re not Bash, JavaScript, or C#.
| Form | Example |
|---|---|
Compare: == != < <= > >= | steps.lookup.total > 0 |
| Contains (string or array) | steps.lookup.names contains "Ada" |
| Exists (postfix) | steps.lookup.names exists |
Combine with and, or, ( ) | steps.lookup.names exists and steps.lookup.total >= 1 |
| Literals | "text", 'text', 42, true, false |
| Any path | steps.*, inputs.*, trigger.*, loop.* |
In the editor, the larger When box suggests properties from earlier blocks. Drag the When and Else handles onto blocks to set their targets.
Check your run
Run with text = hi: has_text runs, empty_text is Skipped, and joined runs. Run again with an empty value and the opposite route runs.
Exercise
Add a third route: if the message contains urgent, go to an escalate block first.
