1. The For Node (Collection Iteration)
The For node loops over an array of items (such as a paginated list of users, order items, or dynamic JSON arrays):
- Target Array Source: A dynamic expression referencing an array (e.g.
{{GetOrders.response.body.items}}). - Dual Handles:
L(Loop Body): Upper right handle connected to the subgraph executed for every iteration item.D(Done): Lower right handle connected to the downstream subgraph executed after all iterations complete.
- Exposed Loop Context Variables:
{{forNode.item}}: The current item in the iteration.{{forNode.index}}: The zero-based iteration index (0, 1, 2...).{{forNode.total}}: Total number of items in the source array.{{forNode.isFirst}}/{{forNode.isLast}}: Booleans indicating array boundaries.
2. The Repeat Node (Count-Based Loops)
The Repeat node runs a connected branch a predetermined number of times:
- Count Expression: Fixed number or dynamic expression (e.g.
5or{{flowVars.maxRetries}}). - Dual Handles:
L(Loop Body): Triggered once per count cycle.D(Done): Triggered once all repetitions finish.
- Exposed Variables:
{{repeatNode.iteration}}: One-based iteration number (1, 2, 3...).{{repeatNode.index}}: Zero-based index (0, 1, 2...).{{repeatNode.total}}: Total repeat target count.
3. The Collect Node (Result Aggregator)
When executing loop bodies, each iteration generates intermediate outputs. The Collect node gathers these outputs into a single consolidated structure:
- Collection Mode:
Append: Aggregates iteration outputs into an array ([result1, result2, result3]).Merge: Merges dictionary objects into a single cohesive payload.
- Source Expression: The specific property to gather (e.g.
{{ProcessItem.response.body.status}}).
Example: Batch Processing Architecture
4. Enterprise Use Case: Batch Processing & Collection
Scenario
An integration flow queries a list of active accounts, iterates through each account to apply a status update, and aggregates all reference numbers into a final summary report:GET /accounts?status=active: Returns an array of 5 account objects.ForNode: Iterates over{{ResponseBinding.GetAccounts.body.items}}.- Loop Body (
POST /accounts/{id}/hold): Dispatches the update for{{forNode.item.accountNumber}}. CollectNode: Aggregates{{ResponseBinding.ApplyHold.body.referenceId}}into an array.- Done Handle (
POST /reports/batch-summary): Dispatches the collected list{{ResponseBinding.Collect.body.items}}to the reporting service.