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.
- 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.
To create a flow execution branch:
- Procedure
- From the
Apps page, click the
app name
then click theflow name
to open the flow details page. - 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:
For example,<Name of activity in main flow>to<Name of activity in branch>
LogMessagetoInvokeRESTService
. - 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.
- Clicking the branch opens the Branch Mapping Settings dialog.
- 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.
- Click Save.
- Add a condition to a branch as required. See Setting Branch Conditions for details.
- 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.