Skip to main content
Version: 1.5.x

Branch

The branch function in Engagespot enables you to implement distinct branches of logic within your workflows. This function allows you to define specific criteria that determine when each branch should execute.

Think of the branch function as an if/else statement, with the added capability to include multiple else if conditions. Each branch can access the complete workflow run scope to assess its conditions. Engagespot will evaluate each branch in sequence and execute the first branch whose conditions are met. This ensures that only the relevant branch of the workflow is activated based on the given criteria, providing a flexible and dynamic control flow within your workflows.

Adding Branch Function

You can insert branch steps at any stage of your workflow, either before or after any function or step. For a branch to be valid, ** each non-default branch must include at least one condition.** These conditions are created using the ** Conditions Builder **, which lets you combine conditions with "and" or "or" boolean operators.

In the example above, the branch named indian_user will execute and send a notification via SMS only if the recipient's country is India. If the recipient's country is not India, the default branch will execute instead, and the notification will be sent via InApp.

tip

You can create conditions for branches that contain any of the types in the ** Condition Builder **

Default Branch

A default branch must always be present for each branch step, even if it doesn't contain any steps. If none of the other branches evaluate to true, the workflow will execute the default branch.

Managing Workflow Branches

Branches in your workflow can be managed as follows:

  • Rename: Update branch names.
  • Reorder: Change the order of branches to modify their execution sequence.
  • Delete: Remove branches entirely, along with all steps contained within them.
info

The default branch cannot be deleted.