Small BusinessReal EstateFinanceMarketingLegalOperationsSalesTemplatesPricingDocs
Get started

Step Guide: For Each

Flow Control

Iterate over array elements

Overview

The For Each step takes an array from an upstream step and iterates over its elements, executing a set of body steps once per element in parallel. It's the entry point of a loop pattern that always ends with a Collect step.

When to Use

  • Process each row from a CSV or Google Sheets import individually
  • Run AI analysis on each item in a list
  • Send personalized emails to a list of recipients
  • Look up property or financial data for each item in a batch

How It Works

The step reads the first array field from its input record and creates N parallel iterations, one for each element. The item output (slot 1) represents a single element from the array. All steps between For Each and its paired Collect step are the "loop body" and execute once per iteration. If the array is empty, For Each skips the body entirely and advances past the Collect step. The onIterationFailure config controls whether a failed iteration fails the entire run (FAIL) or is skipped (SKIP, the default).

Tips
  • Always pair For Each with a Collect step to close the loop
  • The loop body steps run in parallel across all iterations
  • Use the SKIP failure mode to continue processing even if some iterations fail
  • Connect CSV Import or Google Sheets Import output to For Each input to iterate over rows
  • Maximum array size is 5,000 elements (enforced by the system)