Order in which Branches Get Executed
When an activity has multiple branches, regardless of the number of branches or the order in which the branches appear in the Web UI, the branch execution follows a pre-defined order.
Note: The flow execution will terminate if it encounters a
Return activity at the end of any branch. In such situations, the activities that are placed after the branched activity in the main flow do not get executed.
The order in which the branches get executed is as follows:
- Success branch and
Success with condition branch
When an activity has both Success and Success with condition branches, the order of execution depends on the order in which each branch was created. The branch that was created last gets executed first. All Success branches get executed unconditionally, but a Success with condition branch gets executed only if its branch condition is met.
- Success with no matching condition branch
This branch condition is displayed only when there is at least one existing Success with condition branch for the activity. The Success with no matching condition branch is typically used when you want a specific outcome in the event that none of the Success with condition branches meet their condition.
- The Success with no matching condition branch executes only if none of the Success with condition branches execute. If the Success with condition branch executes and it does not have a Return activity at the end of the branch, the flow execution control gets passed to the main flow. If the Success with condition has a Return activity, the flow execution gets terminated after the Success with condition branch executes.
- If an activity has one or more Success with condition branches but does not have any Success with no matching condition branch, if no matching condition is found, none of the Success with condition branches get executed. But, since there is no Success with no matching condition branch, the flow execution control gets passed back to the main flow and the activity next to the branched activity gets executed.
- If you delete all Success with condition branches without deleting the Success with no matching condition branch, you receive a warning informing you that the Success with no matching condition branch is orphaned.
The Error branch gets executed as soon as the flow execution encounters an error.
Copyright © Cloud Software Group, Inc. All rights reserved.