Skip to Content

Workflow.foreach()

The .foreach() method creates a loop that executes a step for each item in an array.

Usage

workflow.foreach(stepOne, { concurrency: 2 });

Parameters

step:

Step
The step instance to execute in the loop. The previous step must return an array type.

opts?:

object
Optional configuration for the loop. The concurrency option controls how many iterations can run in parallel (default: 1)
number

Returns

workflow:

NewWorkflow
The workflow instance for method chaining