For Each

View as Markdown

The For Each node repeats a group of steps for every item in a list. You give it a list and build the steps that should run for each one; inside those steps you can read the current item and its position. It is how a workflow processes many records in a single run.

When to use it

  • You want to do real work for each item in a list, such as calling a service or running an AI step for every contact.
  • You want each item handled in its own isolated pass, so one item’s work does not bleed into the next.
  • You are processing a large list in pieces and want to keep memory in check.

If each item only needs a data reshape rather than its own steps, use Map, which is lighter.

Inputs

FieldWhat it’s forExample
CollectionThe list to loop over, usually produced by an earlier step.A list of policyholders to process
StepsThe set of steps that run once per item. Inside them you can read the current item and its position.Look up each policyholder, then log the result
Collect resultsTurn on to gather each pass’s result into a list you can read afterward. Leave off for large loops.On, when a later step needs every result

Outputs

FieldWhat you get back
CountHow many items were processed.
ResultsEach pass’s result, when Collect results is on. Otherwise this is empty.
SuccessWhether every pass completed without a failure.

Example

An agency needs to enrich a list of policyholders one at a time. A For Each node loops over the list, and for each person its inner steps prepare a clean record and run an AI classification. The loop runs in order, one policyholder after another, so Sarah Chen is fully processed before Marcus Johnson begins. Because no later step needs the combined output, Collect results stays off to keep the run lean.

The For Each node configuration panel, showing the collection to loop over and the collect-results option.

Leave Collect results off unless a later step actually needs every pass’s output. Gathering results from a long loop can grow large fast; when it is off, each pass is still visible in the run history.