Skip to main content

Boucle

Iterates over an array (forEach, map, reduce) or repeats a number of times (times, while, doWhile). Each iteration can accumulate results. Six modes available: forEach, map, reduce, while, doWhile, times.

Common parameters

ParameterTypeRequiredVariableDescription
loopTypechoice (forEach, times)YesNoLoop type: iterate over an array or repeat N times.
indexVariabletextNoNoVariable name for the current iteration index (0, 1, 2...). (Default: "index")
parallelExecutionbooleanNoNoRun multiple iterations in parallel (faster for independent API calls). (Default: false)
concurrencynumberNoNoMaximum number of iterations running concurrently (if parallel execution is enabled). (Default: 5, min 2, max 10)
errorPolicychoice (stop, continue)NoNoError behavior: stop immediately or continue and collect errors. (Default: "stop")
outputVariabletextNoNoOutput variable name to store results from all iterations.

Parameters by loop type

forEach — For Each

Iterate over each element of an array. Blocks connected to the "body" output execute for each element.

ParameterTypeRequiredVariableDescription
arraySourcedynamic valueYesYesSource array to iterate over (variable from a previous block or expression).
itemVariabletextNoNoVariable name for the current iteration element. (Default: "item")

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

times — Repeat N Times

Repeat connected blocks a fixed number of times.

ParameterTypeRequiredVariableDescription
iterationsdynamic valueYesYesNumber of iterations to perform.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : loopResults

{
"results": [],
"iterations": 0,
"exitReason": "..."
}

Example

Iterate over a list of items with forEach.

Input :

{"items": ["alpha", "beta", "gamma"]}

Output :

{"results": ["alpha", "beta", "gamma"], "iterations": 3, "exitReason": "complete"}
Tip

exitReason indicates how the loop ended: "complete" (all items processed), "break" (early stop), "maxIterations" (limit reached), or "error". In reduce mode, an additional accumulator field contains the result.