
Types of Control Flow
If
TheIf node routes workflow execution based on a single condition. When the condition evaluates to true, the workflow follows the True branch; otherwise, it follows the False branch.
Switch
TheSwitch node allows routing based on multiple conditions.
It evaluates conditions in order and routes to the first matching branch.
If no conditions match, the workflow follows the default branch.
Condition Sources
TheIf and Switch nodes can evaluate boolean expressions from four different condition sources.
| Data | Compare values from the automation context’s data object |
| Profile | Compare values from the automation context’s profile object |
| Step Ref | Monitor status of previous Send steps |
| JS Condition | Write custom JavaScript for complex logic |
Data
Compare a field within thedata key of the automation context with a value.
| Property | Description | Example |
|---|---|---|
Field | The data object to evaluate | data.foo |
Comparison | The comparison operator to use | is one of |
Value | The value to compare against | bar, baz |
Profile
Compare a field within theprofile key of the automation context with a value.
| Property | Description | Example |
|---|---|---|
Field | The profile object to evaluate | address.country |
Comparison | The comparison operator to use | is |
Value | The value to compare against | Canada |
Step Ref
Check the current status of an upstream Send node, using it’s reference ID (Ref). The Ref value is defined in the Send node’s configuration.| Property | Description | Example |
|---|---|---|
Ref | The send node’s status object | welcome_email.status |
Comparison | The comparison operator to use | is not |
Value | The value to compare against | CLICKED |
CLICKED, DELIVERED, ENQUEUED, FILTERED, OPENED, SENT, SIMULATED, UNDELIVERABLE, UNMAPPED, UNROUTABLE
JS Condition
Use JavaScript expressions when standard comparisons aren’t sufficient.| Property | Description | Example |
|---|---|---|
Expression | The javascript expression to evaluate | data.expiry < (new Date()).getTime() |
JS Condition examples
Javascript Expressions in Value Fields
Javascript expressions can also be used in theValue field of Data, Profile, and Step Ref sources.
Examples