AutomationTasks

For Each

Run a workflow for each item in an array.

Task type: For Each

Use For Each to run a nested workflow once for each item in an array.

Run behavior

  • Side effects: This task can change data or call an external system. Test with safe records and be careful when rerunning.
  • Credit usage: This task is not classified as credit-billed by the workflow task registry.

When to use this task

  • Process every prospect returned by Find Prospects.
  • Run a reusable contact workflow for each contact id.
  • Apply parallel or sequential processing to a list of items.

Setup tips

  • Use the variable picker to select an array value.
  • Start with concurrency 1 while testing.
  • Map item fields into the nested workflow inputs explicitly.

Examples

Process prospects

Pass {{ steps.1.prospects }} into For Each, then run a nested workflow for each prospect.

Outputs

  • Aggregate results from each nested workflow run.

Common pitfalls

  • Passing a single object instead of an array.
  • Using high concurrency before validating side effects.
  • Forgetting to cap or review large arrays.

Reference details

These details are generated from the workflow task registry and match the fields available in the builder.

Required fields

  • items
  • workflowId

Variable-aware fields

Fields that accept variable references ({{ inputs.x }}, {{ steps.N.y }}) from the workflow's variable graph:

  • items
  • inputs

Liquid template fields

Fields that are rendered through Liquid (variables plus filters and control flow):

  • items
  • inputs

Builder guidance

When the Workflow Builder Genie configures this task, it follows this guidance:

Validate the items expression resolves to an array and cap concurrency deliberately.

Default configuration

New instances of this task start with the following configuration:

{
  "name": "For Each",
  "outputKey": "for_each",
  "taskType": "For Each",
  "description": "",
  "items": "",
  "workflowId": "",
  "inputs": {},
  "concurrency": 1
}

On this page