Node: Loop / For Each
How to use the Loop node to repeat an action for each item in a list inside a workflow.
The Loop / For Each node walks through a list (an array or a variable holding multiple elements) and runs its inner branch once per item, exposing the current item and its position as variables inside the loop.
When to use it
- Process, one by one, the items of a list a previous step brought back (e.g. an API response with several records).
- Apply the same action (note, message, update) to every item in a list of contacts or tasks.
Configuration
- Source: the variable holding the list, e.g.
$itemsor$response.body.users. Also accepts comma-separated text. - Item variable: the name for the current element inside the loop, defaults to
item. - Index variable: the name for the current position, defaults to
index. - Max iterations: a safety cap, 100 by default.
Outputs
- iteration: the branch that repeats once per item.
- done: the branch that runs once, after the loop finishes.
Example
An "HTTP Request" node returns a list in {{$response.json.users}} → Loop node with source $response.json.users → inside the "iteration" branch, "Log Activity" using {{$item.email}} for each user; once finished, the "done" branch continues into "Close Conversation".
Tips
- The source accepts JSON arrays, variables from earlier steps, or comma-separated text.
- Raise the max-iterations cap if you expect lists larger than the 100 default.
Troubleshooting
- The loop doesn't iterate at all: the source variable is empty or doesn't resolve to a list — check the Variables panel.
- It cuts off before processing everything: the list exceeded the configured max iterations and got truncated.
Related articles
-
Build your first workflow
Omnifox workflows automate your operation: a trigger starts the automation and action nodes do the work. Build a welcome message in minutes.
-
Workflow triggers catalog
Learn which events can start a workflow automatically in Omnifox.
-
Action nodes available in workflows
Discover the actions a workflow can run automatically.
-
Conditions and branching (if/then) in a workflow
Make your flows take decisions and follow different paths based on each contact data.
-
Ready-to-use workflow templates
Start your automations in minutes from prebuilt flows you can customize.