Guide Your Workflow to Different Paths Using the "Branch" Logic

Keragon’s Branch logic allows you to control the flow of your workflows based on specific conditions. With this, you can create dynamic and intelligent automations that adapt to different scenarios by splitting the workflow into multiple paths.

When to Use the Branch Logic

  • Execute different actions based on user attributes (e.g., gender, subscription status).
  • Route leads or tickets to appropriate teams based on priority.
  • Handle different data scenarios without duplicating workflows.

How to Use the Branch Logic

00:00: This guide will walk you through the process of branching within York Aragon workflow. 00:06: Click the plus icon in your canvas to add a new action. 00:10: Navigate and select logic tab. 00:13: Select the branch logic action. 00:16: Choose the branch step in your editor. 00:19: Select the first Branch path. 00:22: Click and rename the branch to something meaningful. 00:26: Add a new condition to the branch. 00:29: Clicking value, 12, map it with any data from your previous steps. 00:34: Choose the select option. 00:37: Click on the comparison field to select the desired conditional operation. 00:42: Click on the second value that you want to check for comparison. 00:46: Fill in the text box with the value that you want to compare. 00:50: Save the current progress. 00:53: Create a new branch in the step and repeat the whole process. 00:58: Celexa Branch step in your editor. 01:01: Click on the name to rename it to something meaningful. 01:05: You can now add actions in each branch, based on the conditions that you have set 01:09: up. 01:10: This guy covered. The detailed steps required to perform branching in the 01:14: karigon workflow.

 

1. Add the Branch Logic Step

  • Open your workflow editor.

  • Click the + icon to add a new step.

  • Navigate to the "Logic" tab.

  • Select the "Branch" action.

2. Configure Branches

  • Click on the "Branch" step in the editor. The step panel lists each branch path, plus a "Test step" button and an "Add new branch" button.

  • Every Branch step also has a Default path on the canvas. It runs when none of the branch conditions are met.

  • Click a branch path to open it, then set the "Branch name" to something meaningful, for example "Male", "Female" or "Other". Clear names also make test results and run details much easier to read, since new branches all start with the same default name.

Add Conditions to Branches

  • Under "Execute this branch if...", choose whether All or Any of the conditions should be true for the branch to run.

  • Value 1 is the variable you want to evaluate. Map it using the variable selector.

  • Comparison is the operator, for example equals, does not equal, contains or starts with.

  • Value 2 is the value you want to compare against, for example "Male".

  • Click "Add condition" to add more conditions to the same branch, or "Add group" to combine conditions into groups.

  • Click "Save" to apply the conditions.

3. Add More Branches if Needed

  • Click "Add new branch" to create additional paths.

  • Repeat the process of adding conditions for each branch.

Note on how branches are evaluated. The Branch step evaluates one branch at a time, from left to right, and takes the first branch whose conditions are met. Only that branch runs. Any branches to its right are never checked, even if their conditions would also be met. Keep this in mind when ordering your branches, and place the most specific conditions first. When you test the step, branches that were skipped this way show as unchecked (see section 6).

4. Rename the Branch Step

  • Click on the title of the Branch step and rename it to clearly indicate its purpose.

5. Add Actions Under Each Branch

  • Based on the logic paths, add the relevant actions under each branch. For example

    • Male sends a custom message.

    • Female runs a different set of actions.

    • Default handles cases that don’t match any specific criteria.

6. Test the Branch Step

  • Open the Branch step and click "Test step". Only the Branch step is evaluated. The steps that come after it will not run as part of the test, so it is safe to test even when later steps write data to other systems.

  • The test panel has three tabs. Details shows the run status, Inputs lists each branch with its name and the condition that was evaluated, and Outputs shows which branch was taken and what happened to every other branch.

  • Tip. Before testing, run the steps above the Branch step so their data is available for the conditions to evaluate.

Reading the Outputs tab

branchTaken shows the name of the branch the run would follow. If no condition was met, it shows Default.

branches lists every path out of the step, including Default, in the same left to right order the canvas draws them. Each entry has a position, a title and an outcome. The position tells branches apart even when two of them share the same name.

OutcomeWhat it means
matchedThe conditions were met and this is the branch the run takes
did-not-holdThe conditions were checked and were not met
uncheckedThe branch was never evaluated because an earlier branch already matched. This is not the same as failing
usedShown on Default when no branch matched, so the run falls through to Default
not-usedShown on Default when a branch matched, so Default is skipped

Example 1. The first branch fails and the second one matches

{
  "branchTaken": "Send to channel product",
  "branches": [
    { "position": 1, "title": "Send to channel bots",    "outcome": "did-not-hold" },
    { "position": 2, "title": "Send to channel product", "outcome": "matched" },
    { "position": 3, "title": "Default",                 "outcome": "not-used" }
  ]
}

Example 2. No branch matches, so the run falls through to Default

{
  "branchTaken": "Default",
  "branches": [
    { "position": 1, "title": "Patient is in Alabama", "outcome": "did-not-hold" },
    { "position": 2, "title": "Patient is in Alaska",  "outcome": "did-not-hold" },
    { "position": 3, "title": "Default",               "outcome": "used" }
  ]
}

Example 3. Two branches would both be true

Here both branches kept the default name, so position is the only thing that tells them apart. The first branch matches, and the second is never evaluated, so it reads unchecked. If you expected the second branch to run, reorder your branches or make their conditions more specific.

{
  "branchTaken": "If condition is true then...",
  "branches": [
    { "position": 1, "title": "If condition is true then...", "outcome": "matched" },
    { "position": 2, "title": "If condition is true then...", "outcome": "unchecked" },
    { "position": 3, "title": "Default",                      "outcome": "not-used" }
  ]
}

Because the Branch step records its inputs and outputs, the run details for a published workflow also show which branch was taken on each run, in this same format.

Testing a Continue If step

A Continue If step only has one question to answer, whether the run carries on. Its Outputs tab shows { "continued": true } when the condition holds and the run would continue, and { "continued": false } when the condition fails and the run would stop.

Available Comparison Operators

OperatorExplanation
is trueChecks if a value is true
is falseChecks if a value is false
is nullChecks if a value is null
is not nullChecks if a value is not null
is emptyChecks if an array is empty
is not emptyChecks if an array is not empty
equalsChecks if two values are equal
does not equalChecks if two values are not equal
greater thanChecks if a value is greater
greater than or equalChecks if a value is >= another
less thanChecks if a value is less
less than or equalChecks if a value is <= another
starts withChecks if a string starts with value
does not start withChecks if a string doesn't start with value
containsChecks if a string contains value
does not containChecks if a string doesn’t contain value
Note. Conditions in the Branch step expect data in the Value 1 field to be in text format. If you are using a field that contains numeric data, add a Number to text Helper step before the Branch step to make sure the condition is evaluated correctly.

 

Example Use Case:

  • Check the patient’s gender and perform actions accordingly:
    • If gender = Male, trigger a notification for a male-specific program.
    • If gender = Female, schedule a follow-up for a female wellness program.
    • Else, send a general message.
Was this article helpful?
0 out of 2 found this helpful

Articles in this section