Process Tasks in Parallel with a Parallel Action

You can use a parallel action to process tasks in parallel to improve integration performance and response times. A parallel action allows the path of an integration to be split into multiple branches. Each branch is processed in parallel due to their independence from each other. Messages are sent to each service endpoint in parallel.

When all tasks are completed, all branches are automatically synchronized and merged at their termination points in the parallel action and the main path of the integration is resumed. Any variables created inside the parallel branches (for example, invoke responses) are available for use in the main path.

Want to see a video demo of the parallel action?

Use Cases

A parallel action is useful for use cases such as the following:
  • An order processing integration contains individual tasks for checking inventory, customer credit, and legal constraints. These tasks are processed in parallel to ensure a better response time.
  • An integration obtains the lowest price for an item from suppliers. The integration checks three suppliers for prices and takes the best offer. The three price checks are done in parallel because they are independent of each other. Once the three suppliers have responded, the branches are terminated. The three prices are compared to identify the lowest. The integration then continues its main path by placing the order with that supplier.
  • An integration processes an incoming order from both an inventory and legal perspective (for example, can the product be shipped to the customer's country). Both checks are done in parallel.

Guidelines and Restrictions

  • You can create a maximum of five branches to a parallel action. If you attempt to create a sixth branch by selecting Actions Actions icon, and then Add on the parallel action, the selection is disabled.
  • There is no limit to the number of parallel actions you can include in an integration.
  • Synchronous and asynchronous integrations are supported.
  • You cannot add a parallel action inside another parallel action.
  • Parallel actions can be used in application integrations and schedule integrations.
  • Only map, scope, switch, logger, JavaScript, B2B, and notification actions and invoke connections are supported in a parallel action branch.
  • You can add parallel actions to the branches of a pick action.
  • You can add parallel actions inside scope and switch actions.
  • Nesting of parallel actions in for-each actions, while actions, or stage file actions with chunking is not supported.
  • No independent branch-specific fault handling is supported. You can catch faults at the integration level with a global fault handler.
  • Synchronization of global variables is not supported.
  • Branch-specific timeouts are not supported.

Design Time Behavior

The following example provides a high-level overview of how to design a specific parallel action. This is just one example of parallel action use.

  1. Add a parallel action to an integration in either of the following ways:
    • On the side of the canvas, click Actions Integration actions icon and drag the Parallel action to the appropriate location.
    • Click Add icon at the location where you want to add the parallel action, then select Parallel.

    A parallel action with two branches is created.


    This image shows a trigger, map, invoke, a parallel action with two branches.

  2. Select Actions Actions icon to perform the following tasks.
    • Edit: Change the name of the parallel action.
    • Add: Add more branches. You can add a maximum of five branches.
    • Delete: Delete the parallel action.
    • Collapse/Expand: Collapse or expand the parallel action.
    • Cut: Cut the parallel action and paste it elsewhere in the integration. You can also cut and paste existing maps/invokes into the new parallel branches to make them process in parallel. You cannot cut an individual branch of a parallel action and paste it into another parallel action.

      See Cut and Paste Elements in the Integration Canvas.

    For this example, a third branch is added.


    The Parallel branch includes Branch 1, Branch 2, and Branch 3. Each branch has an action (…) menu for performing other tasks.

    For this example, the three branches are designed to obtain loan offers from three service endpoints and then select the best one.

  3. Add and configure three REST Adapter connections to invoke the following service endpoints. At runtime, all three loan service endpoints are invoked in parallel to identify their specific loan offers.
    • American Loan
    • United Loan
    • Star Loan
  4. In the mapper for each invoke action, map your SSN to the loan application for that service endpoint.


    The Parallel branch includes Branch 1, Branch 2, and Branch 3. Within each branch is a map action and an invoke action. The three branches come together at the bottom.

    At the bottom, the three branches are synchronized at their termination points and the parallel action rejoins the main branch of the integration. The main integration does not continue until all branches are complete

  5. Add a switch action to define the routing rules to check for the best offer returned from the loan service endpoints.


    The switch action routing rule is shown: APR < APR AND APR < APR.

  6. Define the message in a log action for each switch branch.


    The logger message is shown: concat(string('loanOffer-providerName='),providerName)


    This image shows a switch with three branches (route 1, route 2, and an otherwise branch). Each switch includes a logger action. An end icon appears at the end of the integration.

    When complete, the integration looks as follows.

    This image shows the completed integration. It consists of a trigger, map, invoke, a parallel action with three branches (each branch consisting of a map and an invoke), and a switch with three branches (route 1, route 2, and an otherwise branch). Each switch includes a logger action. An end icon appears at the end of the integration.

    The integration is now ready to be activated and invoked.

Runtime Behavior

You can view the status of parallel branches in the activity stream during runtime. For example, assume your integration is designed with the following:
  • One parallel action with two branches
  • A second parallel action with three branches


This image shows an integration with a trigger, map, invoke, a parallel action with two branches (each branch consisting of a map and an invoke), and a second parallel action with three branches (each branch consisting of an invoke). Below this is a map.

  1. Invoke an instance of your integration and go to the Instances page.

    During runtime, the activity stream shows both parallel actions and their number of branches. For this example, both parallel actions processed successfully.


    The activity stream shows the Tracing level set to Production. Three icons appear to the right. The stream shows the major milestones, including expandable entries for the Parallel Action with two branches and the Parallel Action with three branches.

  2. Expand each branch to view more specific details.