ForEachParallel
The ForEachParallel block is a specialization of the ForEach block that you can use to concurrently process a set of actions in parallel for multiple elements in an array.
This block does not run any actions independently by itself. Specify which actions you want to be repeated by placing blocks between the ForEachParallel block and the End For line.
Procedure
The ForEachParallel block works well with the Assign
block. To integrate the ForEachParallel block into your workflow, complete the following steps:
- Drag and drop a ForEachParallel block onto your chosen location in the workflow.
- In the List field, enter the array that you want to iterate
through.Note: The array must be specified in the format
[*], where*represents the items you want to iterate over. Separate the array elements by using commas, for example,[1,2,3,4,5,6,7,8,9,10].Iterations begin with the first element from the list
(index=0), progressing sequentially until the last element of the list(index=(n-1)), wherenis the total number of elements. - In the Concurrency field, enter the number of parallel iterations that
you want to run. For example, enter 2 to run two iterations at a time in
parallel until the number of array elements is reached.Note:
The block exhibits different behavior, which depends on the scope set in the Start block.
- Configure the Assign block according to the actions that you want to run. For example, in the variable field, enter $result, and in the value field, enter $result+1.
- Press Run to apply the changes.
Disabling the ForEachParallel block
To temporarily disable the ForEachParallel block without deletion, turn off the switch in the block header.