Skip to main content
Loop

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 over
Max Iterations: Safety limit (default: 200, max: 2000)

Advanced Options

Concurrency: Enable parallel processing of loop iterations When enabled, all iterations run simultaneously instead of one after another. This significantly speeds up loops but requires that iterations don’t depend on each other.
With concurrency enabled, iterations may complete in any order. Don’t use concurrency if later iterations depend on results from earlier ones.
Collect Outputs: Gather all iteration results into a single array When enabled, the loop end node outputs an array containing results from every iteration. This is useful for aggregating data processed in the loop. The collected output is also available to nodes that run later in the same workflow run, including nodes inside an enclosing outer loop.
Collected Output Structure:
Use Collect Outputs when you need to aggregate results, create reports from all iterations, or pass loop results to a downstream node for final processing.

Inside the Loop

The loop node’s slug becomes your variable name. Access the current item and iteration info:

Example Use Cases

Process Customer List

Batch Update Records

Generate Individual Reports

Parallel Image Processing (Concurrency)

All images are analyzed simultaneously, completing much faster than sequential processing.

Aggregate Results (Collect Outputs)

The final Agent receives all summaries at once to create a comprehensive report.

Best Practices

Prevent infinite loops and runaway costs. Set a reasonable maximum.
Instead of 100 individual agent calls, batch items into groups of 10.
Add a condition before the loop to check if array has items.
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 0.10each=0.10 each = 10 per run.

Next Steps

Agent Node

Process items with AI

Cost Management

Optimize loop costs