Skip to main content

Parallel

The Parallel Task enables concurrent execution of multiple independent branches of tasks. Each branch runs in parallel, allowing integrations to complete faster by overlapping operations that do not depend on one another.

Consider a common scenario where you need to publish data to two different APIs. Previously you would orchestrate those calls in sequence or via separate Flow Executions using the Flow Invoker task pattern. With the Parallel task you can now run both calls in parallel within the same Flow to simplify design and review outcome in a single Execution.

Parallel Task
Parallel Task Design
Parallel Branches

Parallel tasks supports between 2 and 5 branches.

Advanced Features

Parallel tasks support Async Operations like HTTP Callback and EventIngress but does not allow for nesting Parallel Operations (e.g. running a ForEach or Parallel task within a Parallel task).

Configurable Options

The Parallel Task requires the following configuration.

ConfigurationDescription
Branch NameName for the branch. This label will appear on the line between the Parallel Task and your branch context window, and in the Flow Execution Step Logs
Branch InputTemplated Input defines the input to each branch of Execution
Parallel Task Options
Parallel Task Configuration
Execution State within a Branch

Each branch maintains it's own Execution.State. Any State data available before the Parallel task will not be available from within the branch. Any details required can be mapped into the branch using the Branch Input configuration.

State data within each branch will not be available after the branch completes. Please use an End Task to return any output from the current branch.

Runtime

Tasks executing within a Parallel branch have additional details available at runtime via the Execution variable.

Runtime VariablesDataTypeDescription
Execution.BranchRequestJsonBranch Input configured in your task configuration
ASync Operations within a Branch

Each Branch will have it's own ASync Id (Execution.AsyncId) allowing you to have parallel ASync Operations, e.g. HTTP Callbacks.

The Parallel task will not complete until all branches (and nested async tasks) have completed.

Task Output

The Parallel task returns all Branch Responses as it's output letting you process the results or react to failures.

Output VariablesDataTypeDescription
ResponsesJsonResponses object contains the output of each Branch using the Branch Name as the attribute
    StatusStringSuccess or Failure
    OutputJsonBranch Output, populated by an End Task at the end of the sequence of tasks
    ErrorMessageStringThis will only be populated if there is an exception (see Errors below).
Parallel Task Output
Parallel Task Output

Error Handling

The Parallel task will execute all branches - even if a failure is encountered on one of them. If an exception occurs and you haven't configured Continue on Error in the Advanced tab of your Parallel task the execution will halt. Alternatively you can design your Flow to evaluate the branch results and recover, or fail gracefully.

The Parallel task can throw a ParallelTaskError which denotes an exception while running the tasks within one or more branches. When there is an exception the task error output will include the following:

Error PropertiesDataTypeDescription
FailedBranchesJson ArrayArray of branch names with Status = Failure
e.g. FailedBranches ["Operation1"] means Responses.Operation1 will have Status = failure.
ResponsesJson ArrayArray of output from each branch
    StatusStringSuccess or Failure
    OutputJsonBranch Output, populated by an End Task at the end of the sequence of tasks. Value will be null if branch failed.
    ErrorMessageStringIf there is an error, the error message will be included.
Parallel Task Error
Parallel Task Error

Execution Details

The Execution Details page has been updated to show Parallel Branches nested in the Execution Step Logs.

Parallel Operations in StepLogs
Parallel Operations in StepLogs
Description
1Step Log for Parallel task can be expanded to review logs of each branch
2List of Branches and Branch Name
3List of Tasks within the branch
4Input to branch. You'll see Execution BranchRequest defined here.
5Parallel task output (Responses) from all branches.