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
FieldTypeRequiredDescription
inputVarstringYesVariable name containing the array to iterate
itemVarstringNoVariable name for the current item (default: item)
indexVarstringNoVariable name for the current index (default: loopIndex)
maxIterationsintegerNoSafety cap — stops after N iterations (default: 100)

---

Outputs
HandleFires when
LoopOnce per item — connects to nodes that should run per-item
DoneAfter all items are processed

---

Example: send a message to each company email
  1. Add a Loop node, set inputVar to companyEmails (populated by the Company Emails lookup)
  2. Connect the Loop handle to a Send Email node
  3. In the Send Email node, use {{variables.item}} as the to field
  4. 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 maxIterations conservatively 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.if node inside the loop body and connect its false branch to the Done handle of the loop node.