Overview
The Loop node processes arrays of data - iterate through lists of customers, orders, files, or any collection, applying the same logic to each item.Best for: Batch processing, processing multiple records, generating
individual reports, and iterating over lists.
Configuration
Input Array: Select the array to loop overcustomer, item, record)
Max Iterations: Safety limit (default: 100)
Inside the Loop
Access current item with your loop variable name:Example Use Cases
Process Customer List
Batch Update Records
Generate Individual Reports
Best Practices
Always Set Max Iterations
Always Set Max Iterations
Prevent infinite loops and runaway costs. Set a reasonable maximum.
Batch When Possible
Batch When Possible
Instead of 100 individual agent calls, batch items into groups of 10.
Handle Empty Arrays
Handle Empty Arrays
Add a condition before the loop to check if array has items.
Monitor Costs
Monitor Costs
Loops with AI agents can be expensive. Calculate: cost per item × number of
items.
Cost Warning
Loops can consume significant credits when processing many items with AI
agents. A loop with 100 items and an agent call at 10 per run.