About Branching and Merging Flows
  • 01 Jun 2023
  • 2 Minutes to read
  • Dark
    Light

About Branching and Merging Flows

  • Dark
    Light

Article Summary

Overview

Branching and Merging allows the ability to process multiple Flow steps at the same time, rather than one after the other. Branching creates multiples assignments and the Flow is set to wait for each assignment to be completed before the Flow continues. These assignments can be given out individually so that different employees can handle different tasks. 

For example, a company has a new hire onboarding system that requires work from both the HR department and the IT department. A Flow is started with basic information about the employee - name, start date, etc. The HR department needs to collect employment documentation from the new employee and IT needs to order the employee a laptop before they start. The Flow can be configured with the Branch Step to create an Assignment for HR (perhaps with a Form using the Multiple File Upload control) to collect the documents. At the same time IT has gotten an Assignment telling them to put in a purchase request for that laptop. Once HR and IT have finished their respective assignments the Flow merges with the Merge Step and then completes.

A Flow can only be branched once. This is a design limitation within Decisions to prevent Flows from becoming unmanageably complex.

Threading
Branching Flows and parallel Assignments are not in any way related to Multi-Threading.

Branch and Merge steps do not create Parallel processing and should only be used with assigned forms to create parallel approval processes.

Canceling Branch Assignments

The Merge Step can be used to cancel an assignment. For more information see the step page.

Example

The below example will show where the branch and merge steps are located within the Toolbox, as well as a simple branch/merge process. The Forms used for this example only have a button to show the outcome paths.

  1. In a Flow Designer, drag and drop the Branch step and Merge step from Steps > Flow Management to the workspace.
    Any steps that are anchored between the Branch step and Merge step will run in parallel. However, this is not a true parallel. The steps will not run at the same time, but each step will be able to accept the same input and send their output to the steps within their branch. To take advantage of this new structure, anchor multiple form interactions between the branch and merger.


  2. In the Toolbox, add three Show Form steps from the Favorites category. 
    1. Pick or Create a Form for each Show Form step.
    2. For example purposes, these Forms only have a button on them.

  3. Connect a Branch step to the input of each Form.
  4. Connect the output of each Form to the Mergestep. 
    1. This will merge the output of all Forms into one input for the end step. 
  5. Connect the Merge step to the End step.

Debug

  1. Select Debug in the top action panel.
  2. Select START DEBUGGING.

Stepping through the debugger, each Form is presented in sequence. Each Form's output is held at the Merge step until the other Forms have been processed, after which all form data is combined and sent to the End step.



Was this article helpful?