Sign In

Loop

Iterate over an array of items one-by-one or in configurable batches with a safety cap on iterations.

The Loop node processes each item in an array sequentially. It supports item-by-item iteration and batch processing, with a configurable safety cap to prevent runaway loops.

Configuration

FieldTypeRequiredDescription
sourcePathstringYesVariable path to the array to iterate over (e.g., {{httpRequest_1.body.items}}).
itemVarNamestringNoName of the variable that holds the current item inside the loop body. Defaults to item.
indexVarNamestringNoName of the variable that holds the current index inside the loop body. Defaults to index.
batchSizenumberNoProcess items in batches of this size. Set to 0 for item-by-item processing. Defaults to 0.
maxIterationsnumberNoSafety cap to prevent infinite loops. Accepted range is 1 to 1000. Defaults to 100.

Batch Mode

When batchSize is greater than zero, items are chunked into groups of the specified size. Each iteration receives a batch array instead of a single item. This is useful for bulk API calls that accept multiple records per request.

Safety Cap

The maxIterations value limits the number of source items that will be processed. If the source array contains more items than the cap, the excess items are silently skipped. The cap is hard-limited to 1000 regardless of the configured value.

Output

The Loop node has a single output handle (done) that fires after all iterations complete.

FieldTypeDescription
resultsarrayArray of processed items or batches.
iterationCountnumberNumber of iterations that executed.
totalItemsnumberTotal number of items in the source array.
batchSizenumberConfigured batch size. Only present when batching is active.
currentRunIndexnumberZero-based index of the last iteration.
noItemsLeftbooleantrue when all source items were processed within the cap.

Example

Process a list of users one at a time, sending each an email.

Source Array: {{httpRequest_1.body.users}}
Item Variable: user
Index Variable: i
Batch Size: 0
Max Iterations: 500

Inside the loop body, reference {{loop_1.user.email}} to access the current user's email address.

On this page

Loop | Buildorado