A Loop is a special type of Condition which can be applied to Steps in a Flow. It evaluates whether a recipient matches the Conditions. If they do, the recipient will complete the Step immediately. If the recipient doesn't match the Conditions, the Loop freezes the recipient in the Step and they must wait a specified amount of time before checking the Conditions again.
Loops are often used for reevaluating Person Data for a recipient which could change within the next day. For example, you could use a Loop to send an email at the preferred hour for each recipient by comparing an 'optimal send hour' Person Data with the Global Data HOUR.
It's recommended that you don't set up Loops on Waiting Steps. This is because as the Step is evaluated, the waiting Step will first respect the waiting period. Then, the Loop will check if the recipients meet the Conditions. However, there's a risk that the Conditions would never be met, such as if the conditions are Global Data Conditions looking by the hour. In this case, the hour may have passed when the waiting time is over.
How to Set Up a Loop
- Log in to Staging.
- Open the Flows module and navigate to the Flow you'd like to add a Loop to.
- Click on a Step.
- In the right sidebar, under the 'Details' panel, check the 'Enable loop' checkbox. Below, a Condition editor and 3 more fields will appear.
- Set up the conditions to check for the recipient.
- Set up the retry logic with the 'Try again in' field and dropdown.
- Set up the number of retries in the 'Max number of retries' field.
- Specify the fallback behaviour in the 'After max number of retries' dropdown.
- Click the 'OK' button.
- Click the 'Save' icon in the top toolbar.
The loop has now been configured.
An email Step with a configured Loop