Automations
Loop Node
5 min readnode-logic-loop
Iterate over an array variable and execute downstream nodes once per item — process a list of emails, phone numbers, or any multi-value field.
Loop Node
The Loop node iterates over a JSON array stored in a flow variable and executes all downstream connected nodes once per item. After the last item, execution continues to nodes connected to the Done output handle.
---
Fields
| Field | Type | Required | Description |
|---|---|---|---|
inputVar | string | Yes | Variable name containing the array to iterate |
itemVar | string | No | Variable name for the current item (default: item) |
indexVar | string | No | Variable name for the current index (default: loopIndex) |
maxIterations | integer | No | Safety cap — stops after N iterations (default: 100) |
---
Outputs
| Handle | Fires when |
|---|---|
| Loop | Once per item — connects to nodes that should run per-item |
| Done | After all items are processed |
---
Example: send a message to each company email
- Add a Loop node, set
inputVartocompanyEmails(populated by the Company Emails lookup) - Connect the Loop handle to a Send Email node
- In the Send Email node, use
{{variables.item}}as thetofield - Connect the Done handle to a Move Pipeline Stage node
---
Example: process a list of leads from a MySQL query
json
{ "inputVar": "queryResult", "itemVar": "row", "indexVar": "i" }
Access current row: {{variables.row.email}}, {{variables.row.name}}
---
Tips
- The loop executes sequentially — each iteration completes before the next starts. This keeps execution predictable and avoids rate-limit issues on downstream APIs.
- Set
maxIterationsconservatively for large arrays — hitting 100 nodes × 100 iterations = 10,000 node executions in one run, which may affect run time. - To break out of a loop early, use a
logic.ifnode inside the loop body and connect its false branch to the Done handle of the loop node.