Adding a Workflow loop
To add a Workflow loop, simply click “Add a step” and then choose the “Create a loop” option.

Selecting a resource to loop over
The “Select a variable” dropdown will give you available resources you can loop over. This can be one of:- A multi-select custom field
- An expression that returns a list of values.

Adding steps to a Workflow loop
Once you’ve picked what you want to run your steps over, you can add Workflow steps to your loop using the “Add a step to this loop” button. This works just like adding a regular workflow step, and you can reference the value you are looping over in the step - you’ll find these at the top of any relevant menus, prepended by “Each”. In this example, we are looping over the custom field “Impacted surface”:
How often will workflow loops run?
Workflow loops function slightly differently from regular workflow steps - if the custom field or expression you are looping over changes, the loop will run its steps on any new values. Let’s elucidate this with an example: Imagine you have set up a workflow to run once per incident when the incident severity is critical or higher. You’ve got two steps:- Announce the incident in
#product - For each team in the
Affected Teamscustom field:- Page the relevant escalation policy in PagerDuty
- A critical incident is declared, affecting teams
AandB. The workflow runs, posting the announcement and escalating followingPolicy-AandPolicy-B. - The
Affected Teamscustom field is updated to now include TeamC - The first step, posting the announcement, will not be re-run, since it has already been executed for this incident. However , the second, looping step will “catch up” with the new
Affected Teamsvalue by escalating toPolicy-C.