Skip to content

Loop

The Loop step executes a child step repeatedly for each item in a list. The most common use case is dialing a dynamically assembled list of agents one by one until someone answers.

Loop step configuration showing list of values, current item name, and loop body step fields

Required fields:

FieldDescription
List of ValuesA pipe-separated list of strings (e.g., agent1|agent2|agent3) or a Mustache variable that resolves to a list (e.g., {{apex.agentIdsToDial}}).
Current Item NameThe variable name used to reference the current list item in the child step (e.g., currentAgent).
Loop Body StepThe step executed on each iteration. Drag a step to the Drop a function here target in the flow editor.

Optional field:

FieldDescription
Loop Completed StepA step executed once after all iterations finish. Drag a step to the Loop Completed - Drop a function here target.

Example: A Callout returns a list of Salesforce User IDs as {{apex.agentIdsToDial}}. The Loop step iterates the list and passes each ID to a child Dial step, which calls each agent in turn until one answers.