For the complete documentation index, see llms.txt. This page is also available as Markdown.

Branch Node

Overview

The Branch Node enables builders to direct workflow execution using deterministic, rule-based logic. Rather than delegating decision-making to an Agent and relying on LLM reasoning, the Branch Node evaluates predefined conditions through the Expression Engine to determine the appropriate path.

This approach provides several key advantages:

  • Consistent outcomes – the same inputs always produce the same routing decision.

  • Instant execution – routing occurs immediately without additional processing delays.

  • No LLM dependency – decisions are made directly through expression evaluation.

  • Reduced costs – no LLM calls are required for simple branching scenarios, eliminating unnecessary AI usage costs.

By using the Branch Node, builders can create predictable, efficient, and cost-effective workflows for scenarios that require straightforward conditional routing.


What Problem Does the Branch Node Solve?

Replaces Agent-Based Branching for Simple Logic

Previously, workflow routing often relied on an Agent to determine the next step, which could introduce unnecessary cost, latency, and variability. The Branch Node replaces this with deterministic, rule-based routing for straightforward decisions.

Delivers Predictable Outcomes

The same condition always produces the same result, ensuring consistent and reliable workflow behavior a key requirement for business-critical processes.

Improves Flow Clarity

Branching rules are displayed directly on the canvas, making workflows easier to understand, maintain, and troubleshoot without embedding logic inside prompts.


Why Use the Branch Node?

Lower Runtime Costs

Eliminates unnecessary LLM calls for simple decision-making, helping reduce operational costs, especially in high-volume deployments.

Improved Reliability

Deterministic logic ensures that the same input always follows the same path, providing consistent outcomes.

Faster Performance

Branch evaluation happens instantly without model inference, making it ideal for:

  • Voice applications

  • High-volume chat experiences

  • Real-time workflows

Better Transparency

All branch conditions are visible on the canvas, making workflows easier to audit, review, and debug.


How the Branch Node Works

1. Core Behavior

1. Evaluates Existing Data

The Branch Node routes flows using data that is already available within the workflow, including:

  • Slot values

  • API responses

  • System variables

  • Flow variables

  • Channel, locale, or language information

2. Uses Expression-Based Logic

Each branch is defined using a JavaScript-style expression that evaluates to either true or false.

Examples:

3. Evaluates Conditions Sequentially

Conditions are processed from top to bottom. The Branch Node selects the first condition that evaluates to true.

4. Routes Through Defined Output Paths

Each condition is mapped to a specific output port. When a condition matches, the flow continues through its associated path.

5. Includes a Default Else Path

An Else path is always required and serves as the fallback route when none of the configured conditions are met.

2. Runtime Behavior

First Match Wins

The Branch Node evaluates conditions in order and stops as soon as a matching condition is found. Once a route is selected, no additional conditions are evaluated.

Automatic Fallback Routing

If no conditions match, the flow automatically follows the Else path, ensuring execution can always continue.

No LLM Involvement

All branch evaluations are performed directly by the Expression Engine without Agent reasoning or LLM inference, resulting in faster, more predictable, and cost-efficient routing.


User Workflow

1. Add a Branch Node

Drag a Branch Node from the Flow Editor onto the canvas and place it at the point where the workflow needs to split into multiple paths.

2. Define Branch Conditions

In the node configuration panel, add one or more conditions. Each condition is written as an expression that evaluates data available in the current flow context.

3. Configure Routing Rules

For each condition, specify:

  • The variable or value to evaluate

  • The comparison logic or operator

  • The value or expression to compare against

  • The corresponding output route

4. Map Output Paths

Assign each condition to a dedicated output port. Each port represents a different route the workflow can take.

5. Connect Downstream Nodes

Connect each output path to the next step in the workflow.

Example:

  • Gold Customers → VIP Support Node

  • Standard Customers → Standard Support Node

  • Else → Fallback Node

6. Configure the Else Path

Ensure the required Else path is connected. This serves as the default route when none of the defined conditions are met.

7. Runtime Execution

At runtime, the Branch Node evaluates conditions in order from top to bottom.

  • The first condition that evaluates to true is selected.

  • Remaining conditions are skipped.

  • If no conditions match, the workflow automatically follows the Else path.

This approach ensures routing remains fast, predictable, and deterministic without requiring Agent reasoning or LLM inference.


Supported Condition Patterns

The Branch Node supports a variety of expression patterns, allowing builders to create flexible and deterministic routing logic based on workflow data.

1. Equality Checks

Use equality operators when routing based on an exact value.

Examples:

2. Null and Existence Checks

Verify whether a value exists before proceeding with a specific route.

Examples:

3. Membership Checks

Determine whether a value belongs to a predefined group or list.

Example:

4. Comparison-Based Conditions

Use numeric comparisons for threshold-based or rule-driven decisions.

Examples:

5. Compound Expressions

Combine multiple conditions to support more advanced routing logic.

Example:

Note: Supported expression syntax may vary based on the product implementation. Always validate expressions against the latest platform documentation.


Example Use Cases

1. Customer Tier Routing

Direct customers to different experiences based on their membership or loyalty level.

Example:

2. API Response Handling

Route workflows based on the outcome of an API call.

Examples:

3. Channel-Specific Experiences

Deliver tailored experiences based on the interaction channel.

Examples:

4. Language-Based Routing

Guide users to language-specific content and experiences.

Examples:

5. Eligibility and Qualification Checks

Use slot values, API responses, or computed variables to determine whether users meet specific criteria.

Example:

These patterns enable builders to create clear, deterministic, and maintainable routing logic without relying on Agent reasoning or LLM-based decision-making.


Example from the Demo

Complete flow of the Demo refer to this document

1. Loyalty Points-Based Routing

In the demo, a Set Variable Node first calculated a customer's total loyalty points. The Branch Node then evaluated a series of conditions in sequence, such as:

  • totalPoints > 1000

  • totalPoints < 500

  • totalPoints > 0

  • Else (fallback route)

The workflow followed the route associated with the first condition that evaluated to true, demonstrating deterministic and predictable routing behavior.

2. Deterministic Routing in Action

The presenter compared the Branch Node to a traditional if / else-if / else statement.

Key behaviors highlighted in the demo included:

  • Conditions are evaluated from top to bottom.

  • The first matching condition is selected.

  • Once a match is found, the remaining conditions are skipped.

  • The workflow continues along the selected branch.

This ensures consistent results every time the same inputs are evaluated.

3. Built-In Testing and Validation

The demo also showcased the Branch Node's testing capabilities, allowing builders to validate routing logic before deployment.

The test view helps verify:

  • Which conditions evaluate to true or false

  • Which branch is selected at runtime

  • Whether routing behaves as expected for different input values

This makes it easier to troubleshoot and validate branching logic during flow design.

If calculation succeeds, the flow proceeds to a branching decision.

Setting
Value

Name

route_tier

Branching Rule 1

Expression: total_points >= 2000

Branch Name: platinum

Branching Rule 2

Expression: total_points >= 1000

Branch Name: gold

Branching Rule 3

Expression: total_points >= 500

Branch Name: silver

Branching Rule 4

Expression: total_points > 0

Branch Name: bronze

Setting
Description

Node Name

platinum_message

gold_message

silver_message

bronze_message

no_points_message

Message

This member has {{points}} points, plus a 15% bonus of {{bonus_points}}, for {{total_points}} total — that's PLATINUM tier! Concierge service and every perk unlocked.

This member has {{points}} points, plus a 15% bonus of {{bonus_points}}, for {{total_points}} total — that's GOLD tier! Keep earning to reach Platinum at 2000.

This member has {{points}} points, plus a 15% bonus of {{bonus_points}}, for {{total_points}} total — that's SILVER tier! Free shipping unlocked.

This member has {{points}} points, plus a 15% bonus of {{bonus_points}}, for {{total_points}} total — that's BRONZE tier. Keep earning to reach Silver at 500!

This member has no points yet. Make a purchase to start earning!

Allow barge-in

Yes

Yes

Yes

Yes

Yes

Last updated

Was this helpful?