Category: Control
Node id: loop
Iterates over a pre-loaded array of items with three traversal modes
What it does
- for_each: visit all items with index tracking
- while: iterate and stop early when an item's field becomes false
- until: iterate and stop early when an item's field becomes true
- Context-cancellable with per-iteration graceful shutdown check
- Safety cap via max_iterations
Use cases
- Batch-process a list of FHIR patient records
- Process paginated API results until has_more is false (while mode)
- Walk a result set until the first record exceeding a threshold (until mode)
Runtime
Output ports
Settings
Basic
Advanced
Errors
Runtime notes
- All three modes iterate over a PRE-LOADED array — they do not re-execute downstream nodes on each iteration.
- for_each: visits every item in order. Use this for batch-processing a collection.
- while: visits items in order and stops early when an item's condition_field is falsy. Useful for processing paginated results where each page has a 'has_more' flag.
- until: visits items in order and stops early when an item's condition_field is truthy. Useful for stopping at the first item that satisfies a threshold.
- For a true looping pattern that re-executes downstream logic, combine pipeline-ref with condition branching.
- Context cancellation is checked between iterations for graceful shutdown.
See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.