Control Flow
Overview
Automations can conditionally execute a branch of the workflow. This can be useful in any case where you may want to change the actions of an automation based on certain data sent with the template.
For example, you may want to send one template if one data field represents a certain value, or another template if it does not:
Sources
The Control Flow IF statement has four different source options, data, profile, step ref and JS condition. These sources control whether to follow the True path or the False path by evaluating the sources.
Data
Compare a field within the data
key within the automation context with a value. For example:
Condition | Automation Payload | Evaluation |
---|---|---|
| True | |
| False |
Profile
Compare a field within the data
key within the automation context with a value. For example:
Condition | Automation Payload | Evaluation |
---|---|---|
| True | |
| True |
Step Ref
Step Ref is designed for you to check the current value of a Send node, mainly it's status. See the screenshot below or view the tutorial. In order to use Step Ref, you must have a Send node and have the alias of the Send node defined in its configuration.
CLICKED
| DELIVERED
| ENQUEUED
| FILTERED
| OPENED
| SENT
| SIMULATED
| UNDELIVERABLE
| UNMAPPED
| UNROUTABLE
JS Condition
Sometimes the value checking is not open ended enough to evaluate a condition. Using the JS Condition you can:
- manipulate the field value before comparing
- check for key existence
- Comparing date diffs as ISO strings
- manipulate nested arrays and objects
We will evaluate the manipulation into a Javascript Boolean after the equation
Condition | Automation Payload | Evaluation |
---|---|---|
| False |
JS Condition Values
Within the Data, Profile and Step Ref Sources, you may also use JS String evalution in the value field
Condition | Automation Payload | Evaluation |
---|---|---|
| True |
Tutorial
Below you can find a walkthrough of a sample control flow using step references.