Skip to content

For Each ​

The For Each node iterates over input rows and executes a saved action pipeline for each one. The current row is passed as the parent context to the sub-pipeline.

Configuration ​

PropertyTypeDefaultDescription
actionIdnumber--Required. The ID of the saved action to run for each row.

Input ​

Accepts a single object or an array of rows.

Output ​

Returns an array of results, one per input row. Each result is whatever the sub-pipeline's output node returns.

How It Works ​

  1. The node loads the saved action definition by actionId.
  2. For each input row, it creates a new PipelineExecutor instance.
  3. The current row is set as the parent context of the sub-pipeline.
  4. The sub-pipeline is executed, and its result is collected.
  5. All results are returned as an array.

For a single object input, the action runs once and the result is returned directly.

Example Use Cases ​

Process each order item ​

For each item in an order, run an action that updates inventory:

Related Items (order_items) --> For Each (actionId: "update_inventory") --> Result

The "update_inventory" action pipeline has access to each order item via the parent context.

Send individual notifications ​

For each user in a list, run an action that sends a personalized email:

Table Query (users) --> For Each (actionId: "send_notification") --> Result

Batch data transformation ​

Run a complex multi-step transformation on each row:

Table Query --> For Each (actionId: "enrich_row") --> Result

WARNING

The For Each node creates a new pipeline executor for each row. For large datasets, this can be slow. Use it for small to medium datasets (tens to hundreds of items), not for bulk processing thousands of rows.

TIP

The sub-pipeline accesses the current row via the Parent Data or Context node. All parent row fields are available as context variables.