Break Iteration
Break out of an iterator loop early
Overview
The Break Iteration utility breaks out of an iterator loop when a condition is met. It passes the matching bundle (and optionally all bundles processed before) downstream and signals aggregators that iteration is complete.
Similar to a break statement in programming, this utility stops processing remaining bundles immediately.
Configuration
Source Module
Select which iterator's bundles to stop. Required for the utility to function. In nested iterators, this determines which level to stop.
Output Mode
Controls what bundles are passed downstream:
Match Only
Only pass the matching bundle that triggered the stop. All previous bundles are skipped.
All Until Match
Pass all bundles until the matching one, then stop. Previous bundles flow through normally.
Conditions
Define conditions using the same format as the IF utility. Supports text, numeric, date, array, and boolean operators. Multiple conditions can be combined with AND/OR logic.
Output
When a match is found, outputs include stop markers for the flow executor:
Output fields:
stoppedAtIndex- Bundle index where iteration stoppedoriginalTotal- Original total number of bundlesnewTotal- New total after stopping (for aggregators)- All fields from the matching bundle are included
Examples
Example 1: Find First Active Item (Match Only)
Search through items and return only the first "active" one:
Match Only{{#1.status}}Text: Equal toactiveOnly the matching bundle flows downstream. Previous bundles are skipped.
Example 2: Process Until Error (All Until Match)
Process items until an error occurs, keeping all successful results:
All Until Match{{#3.error}}ExistsAll bundles before the error flow through. Aggregators receive all successful items.
Example 3: Stop at Threshold
Stop when a numeric threshold is exceeded:
All Until Match{{#4.runningTotal}}Number: Greater than1000Process items until accumulated value exceeds 1000. All valid bundles are kept.
Tips
Tip: This utility must be used inside an iterator. It has no effect outside of an iteration context.
Tip: The current iteration will complete before stopping. If you need to prevent the current iteration from completing, use IF instead.
Note: When iteration stops, any aggregators will still receive all items processed up to that point.