> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hubtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 08. Logic Split

> Branching by formulas where the data already sits in variables.

# Branching without a model: Logic Split

> [!NOTE]
>
> **Module goal:** split routes by formulas where the data is already there.

![Logic Split node inspector: equation transitions and Default](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-13-node-logic-split_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=c33cc5f35933aa6970634281103a0a1e)

Logic Split. Three exits: “slots available” by \{\{slots\_count}} > 0, “CRM did not respond” by \{\{get\_free\_slots\_success}} == false, and Default — “no slots”. The client does not hear this node.

Formulas work with variables and context predicates: `node_visited(id)` — whether we have been in the node, `goals_completed()` — whether the agent's required objectives are closed. Equation conditions are evaluated top to bottom, and the first true one wins, so special cases go above general ones. To change the order, drag a transition card by ⋮⋮. If no condition is true, **Default** fires — add it to every Logic Split.

A formula can use:

| Notation | What it checks |
| - | - |
| `==`, `!=` | String equality, case-insensitive |
| `>`, `<`, `>=`, `<=` | Number comparison; if a value is not a number, the condition is false |
| `CONTAINS`, `NOT CONTAINS` | Whether the value contains a substring |
| `exists`, `not exists` | Whether the variable is set and not empty |
| `AND`, `OR`, parentheses | Combining checks |

A missing variable counts as an empty string: `==` and number comparisons are false for it, `!=` is true.

You can also branch on the contact's campaign data. For example, under the US market profile (`us_tcpa`) — on the state from the `contact_state` column: `{{contact_state}} == "CA"`. A contacts file column reaches the agent under the same name, see [Campaign contacts](https://docs.hubtalk.ai/v4/platform/campaigns/contacts.md). If the variable is missing, the condition is false and the next transition in order fires.

> [!NOTE]
>
> **Why not ask the model**
>
> A formula is free, instant and behaves the same way every time. A classifier is a model call: you need it only when the decision depends on *the meaning of what the person said*. Logic Split also accepts prompt conditions, but the model checks them only after all the formulas. Tip: if the value already sits in a variable, it is a formula.

> [!TIP]
>
> **Practice**
>
> Build a chain in your agent: Extract Variables (date) → Function with a stub (free slots) → Logic Split (slots available / error / no slots) → two different replies. Walk it through in the chat test — [module 20](https://docs.hubtalk.ai/v4/tutorial/testing.md) shows how to read the trace.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.