Creating a Flow Execution Branch

Activities in a flow can have one or more branches. If you specify a condition for a branch, the branch runs only when the condition is met. You also have the option to create an error branch from an activity. The purpose of the error branch is to catch any errors that might occur while running an activity. Branching is also supported for Error Handler flows, to catch all errors at the flow level.

Note:

  • You cannot create a branch from a trigger or a Return Activity.
  • All activities that come after a branch are run irrespective of how the branch condition evaluates.

A Return activity ends the flow execution. Regardless of where the Return activity is placed in the flow, the flow execution exits the process as soon as it encounters a Return activity anywhere in the flow.

Note: A Return Activity is not added by default. Depending on your requirements, you must add the Return Activity manually. For example, if any trigger needs to send a response back to a server, its output must be mapped to the output of the Return Activity in the flow.

To create a flow execution branch:

    Procedure
  1. From the Apps page, click the app name then click the flow name to open the flow details page.
  2. For a start branch, drag a connection line from the a blue arrow on StartActivity icon to the desired activity that you want to start the execution with.

    A branch gets created.

    Each branch has a label associated with it. The label has the following format:

    When branching to a specific activity:

    <Name of activity in main flow>to<Name of activity in branch>

    For example, LogMessagetoInvokeRESTService.

  3. You can add a branch between the two activities. Hover over the activity that you want to start with and drag a connection line to the activity you want to connect to.
  4. Clicking the branch opens the Branch Mapping Settings dialog.
  5. Select either of the branch conditions: Success, Success with condition, Success with no matching condition, or Error. See Types of Branch Conditions for details on the conditions.
  6. Click Save.
  7. Add a condition to a branch as required. See Setting Branch Conditions for details.
  8. If you want the flow execution to end after this branch is run successfully, add and configure the Return activity at the end of the branch. If you do not want the flow execution to end, do not add a Return activity at the end of the branch.

Joining or merging branches

You can now connect multiple activities to a single activity. In this case, an activity is executed only after all connected activities are either executed or skipped due to conditional branch.