Parallel For

Learn how to iterate over a bunch of steps dynamically.

Last published at: March 30th, 2026

parallelFor

Description:

The Parallel For step enables a FlowWright workflow to execute a collection of workflow activities concurrently for multiple items.

Instead of processing each item sequentially, the step accepts a list of keys and automatically creates a parallel execution path for every key in the collection. During each parallel iteration, the current key is assigned to a workflow variable, allowing downstream workflow steps to process that specific item independently.

This approach is particularly useful for workflows that perform identical operations on multiple records where each iteration is independent of the others.

Typical uses include:

  • Processing multiple documents simultaneously
  • Executing approval tasks for multiple users
  • Sending notifications to large recipient lists
  • Processing batches of customer records
  • Updating multiple database records
  • Calling REST APIs for multiple objects
  • Processing multiple files or folders
  • Performing large-scale data synchronization

The Parallel For step improves workflow performance by allowing independent operations to execute concurrently while maintaining a single logical workflow.

 

Inputs

  • Provide a List of Keys – A list of keys, comma-separated, e.g., 1,2,3. Specifies the collection of keys or values to iterate over. A separate parallel execution path is created for each key in the list.
  • Variable to Hold Key Value – Specifies the workflow variable that receives the current key during each parallel iteration. Downstream workflow steps use this variable to process the current item.
 

 

Returns

  • True – The parallel iteration was successfully initialized. Workflow execution enters the parallel processing block and begins processing each key concurrently.
  • False - The parallel iteration could not be initialized because of an invalid key list, missing configuration, invalid workflow variable, or another execution error. Workflow execution follows the alternate path.
 

 

The parallelForEnd step lets you define the end marker step.

 

Inputs

  • None - The uploaded XML does not define any configuration properties for this step. The step simply marks the end of a Parallel For block.
 

 

Returns

  • The uploaded XML does not define explicit return paths for this step.

Note: Unlike most workflow steps, Parallel For End functions as a synchronization marker rather than a decision point. Once all parallel execution branches have reached this step, workflow execution automatically continues with the next connected activity.

 

 

Usage:

The Parallel For step is typically placed before a group of workflow activities that should execute simultaneously for every item in a collection. The parallel block is completed using the Parallel For End step, which synchronizes all branches before workflow execution continues.

During execution:

  1. Read the list of keys.
  2. Create a separate execution branch for each key.
  3. Assign the current key to the configured workflow variable.
  4. Execute the workflow activities within each branch concurrently.
  5. Continue processing until all parallel branches reach the Parallel For End step.
  6. Resume normal workflow execution after synchronization.

A typical workflow might look like this:

 

Typical workflow scenarios include:

  • Processing thousands of customer records
  • Converting multiple PDF documents simultaneously
  • Sending notifications to multiple recipients
  • Updating numerous database records
  • Processing imported XML or JSON objects
  • Executing independent REST API requests
  • Performing parallel document approval operations

 

Example:

Let’s build and execute the “parallelFor-parallelForEndDef” example.          

  • Create a new definition called “parallelFor-parallelForEndDef” and open the definition in designer mode. 
  • Drag the “parallelFor, parallelForEnd, Synchronize, Placeholder, and Decision steps” step to the canvas. 
  • Connect the dots between the “Start” step and other steps, as shown above.
  • Define a variable or a global variable to store the key value.
  • Click the "parallelFor" step to configure its "Required" properties. Provide a name for the step. Provide a list of key values as shown below. The keys are comma-separated (e.g., 1,2,3 in this example), and the steps are iterated three times. A variable reference can also initialize the keys (e.g., 7, 3, 10), and the steps are iterated 3 times. The keys are always comma-separated by design. For example, key-value 3 iterates only once, not three times. Provide the variable or global reference to hold the key value. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description. 

 

  • Click the "decision" step to configure its "Required" properties. Provide a name for the step and the condition to evaluate. Then click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description. 

 

  • Click the "parallelForEnd" step to configure its "Required" properties. Provide a name for the step, then click the Save button. Note: Click the "AI Predict" button to have the Copilot add new process steps that match your process description. 

 

  • Save the process definition, create a new instance, and execute it. Render the process instance. Once executed, the workflow will automatically expand to include as many paths as there are keys, as shown below.

 

Tips:

  • Use this step only when each iteration is independent and does not rely on the results of another iteration.
  • Minimize shared resource contention between parallel branches.
  • Store only the current key in the iteration variable and retrieve additional data within each branch as needed.
  • Ensure downstream activities are designed to execute safely in parallel.
  • Always terminate the parallel processing block with a Parallel For End step.
  • Route the False path to logging or notification activities to simplify troubleshooting.
  • Combine this step with REST Call, Send Email, PDF processing, Database Update, Archive Process Instance, or other workflow activities to maximize throughput.

 

Notes:

  • Both Provide a List of Keys and Variable to Hold Key Value are required.
  • A separate workflow execution branch is created for every key in the supplied collection.
  • Each branch receives its own copy of the current key value.
  • Parallel branches execute independently until they reach the Parallel For End step.
  • Downstream workflow activities should be designed for concurrent execution.
  • Both the True and False return paths should be implemented to provide complete workflow handling.
  • Execution details for each parallel branch are recorded in the FlowWright workflow execution log.

 

Parallel For vs. Parallel For End:

Although these steps are used together, they perform different functions within a parallel processing block.

Parallel For Parallel For End
Begins a parallel iteration block. Marks the end of a parallel iteration block.
Creates one execution branch for every key in the supplied list. Synchronizes all parallel branches before workflow execution continues.
Requires a list of keys and an iteration variable. Requires no configuration properties.
Assigns the current key to a workflow variable for each branch. Does not modify workflow variables.
Initializes concurrent processing. Completes and joins concurrent processing into a single execution path.

As a general guideline:

  • Use Parallel For when a workflow needs to execute the same processing logic concurrently for multiple independent items.
  • Use Parallel For End to close the parallel processing section and ensure all parallel branches have completed before subsequent workflow activities begin.

 

Definition Sample:

You may download the sample workflow definition from the link provided and import it into your FlowWright environment.

Note: Verify and complete any missing configuration after importing the sample, including:

  • List of keys
  • Workflow variable for the current key
  • Workflow activities inside the parallel block
  • Placement of the Parallel For End step
  • Success and failure workflow branches

After verifying the configuration, save and publish the workflow before execution.

Click here to download the sample file.