The For Each node runs the same body script once for every item in a collection, either one at a time or all at once. Use it to loop over a list or to fan work out across a runner. This article is for workspace users with the Admin role or higher who build workflows in the Designer.
- Choosing the Collection
- Reading the Current Item
- Mode: Parallel vs. Sequential
- Max Items and Truncation
- Failure Policy
- Item Timeout and Shared Parameters
Choosing the Collection
Add a For Each node from the Logic section of the palette. The collectionExpression field is a binding expression that must resolve to an array, for example {{ nodes.fetch.output.companies }}. The node runs its body once per element of that array.
Reading the Current Item
The itemVariableName field names the value injected into each run (default item). The body reads it the same way any script reads a named input — for example Get-NodeInput -Name item in PowerShell. The bodyLanguage field selects the language the body runs in: PowerShell, Python, or C#.
Mode: Parallel vs. Sequential
- parallel — fan out one runner step per item so they run concurrently, for throughput (the default)
- sequential — run one item at a time, for ordering or to respect a downstream rate limit
Max Items and Truncation
The maxItems field caps how many items are materialized in one fan-out. The default is 500 and the value cannot be raised above 2000. If the resolved collection holds more items than maxItems, the step fails rather than silently processing a subset — lower the count by narrowing the collection, or raise maxItems toward the 2000 ceiling.
Failure Policy
- continue — a failed item does not stop the others; its status surfaces in the aggregate result (the default)
- failFast — any item failure fails the whole batch
Item Timeout and Shared Parameters
The timeoutSeconds field is the per-item timeout, from 1 to 1800 seconds (default 1800) — the same 30-minute hard cap that applies to script steps. You can also define shared parameters bindings that are injected into every item in addition to the item value, so each run sees both its element and the common inputs you map.
Comments
0 comments
Please sign in to leave a comment.