
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.
Comparison Operators
The following operators are available for Data, Profile, and Step Ref conditions:| Operator | Description |
|---|---|
| is (eq) | Exact match |
| is not (neq) | Does not match |
| is one of (one_of) | Matches any value in a comma-separated list |
| contains | String contains substring, or array contains value |
| does not contain | String/array does not contain value |
| greater than (gt) | Numeric greater than |
| greater than or equal (gte) | Numeric greater than or equal |
| less than (lt) | Numeric less than |
| less than or equal (lte) | Numeric less than or equal |
| starts with | String starts with prefix |
| ends with | String ends with suffix |
Condition Sources
TheIf and Switch nodes can evaluate boolean expressions from four different sources:
| Source | Description |
|---|---|
| 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