About Parallel Loop Execution

When a Loop adapter is set to run all iterations in parallel (For or For Each), the behavior of input/output parameters is different from when the iterations are run sequentially.

When the iterations are run sequentially, each iteration sees the value of input/output parameters as they are updated by previous iterations. When the iterations are run in parallel, all iterations see the value that the input/output parameter had when the Loop adapter started, ignoring any changes made by other iterations.

For example, assume a For loop that increments parameter i from 1 to 5, and has an input/output parameter n initially set to 0. The subflow consists of a calculator that evaluates the expression: n = n + i. If the loop is run sequentially, n will take on the values 1, 3, 6, 10, and 15 at the end of each iteration. The final value of n is 15. If the iterations are run in parallel, each subflow sees the input value of n as 0; therefore, the output values are 1, 2, 3, 4, and 5, and the final value of n is 5.