Skip to main content

Control Flow

Control flow steps allow deterministic branching, computed variables, and jumps.

if Step

Conditional branching based on expressions.

- if: "$user.entitlements.tier == 'premium'"
then: continue
else:
- goto: standard_flow

set Step

Define computed variables that are stored in $variables.

- set:
total_with_tax: "$variables.subtotal * 1.08"
is_premium: "$user.entitlements.tier == 'premium'"

goto Step

Jump to a named step.

- goto: retry-payment

A step name creates the target slug:

- action:
name: Retry Payment
call: payments.charge

Combining Control Flow

journey:
- collect: [email]
- action: customers.lookup -> customer
outcomes:
found: continue
not_found:
- goto: new-customer
- set:
is_premium: "$variables.customer.tier == 'premium'"
- if: "$variables.is_premium"
then:
- done: "Thanks for being premium"
else:
- done: "Thanks for being with us"