# Pathway Edges

## Pathway Edges

Edges define the transitions between nodes in a pathway. Each edge connects a **source** node to a **target** node and controls when and how the conversation moves forward.

You can use them to:

* Move the conversation forward after a user responds
* Route users to different nodes based on extracted variable values
* Transfer to a human agent when specific conditions are met

<figure><img src="/files/zvYnyz3eel0wuAzkGBfa" alt=""><figcaption></figcaption></figure>

### Edge Properties

Each edge has the following properties:

| Field                     | Description                                                            |
| ------------------------- | ---------------------------------------------------------------------- |
| **Label**                 | Short text shown on the edge describing when this transition occurs    |
| **Description**           | Optional longer text used as a tooltip or helper note                  |
| **Conditions**            | Optional rules that determine when the edge is automatically triggered |
| **Always take this edge** | When enabled, this edge is always taken regardless of user input       |

### Edge Label

The label is the primary way the AI decides which edge to take during a conversation. It should clearly describe the user action or intent that triggers the transition.

**Examples of good labels:**

* `User confirms appointment`
* `User wants to end the call`
* `User asks a general question`

### Edge Description

The description is an optional field that provides additional context about when this edge should be taken. While the label is a short phrase used by the AI for edge selection, the description can be used to clarify the intent further or add notes for other team members reading the pathway.

Use it when the label alone is not enough to capture the full routing intent, or when you want to document the reasoning behind a particular transition.

### Always **take this edge**&#x20;

If an edge should always be taken after a node completes — regardless of what the user said — enable the **Always** toggle on that edge. Always edges bypass LLM edge selection entirely, which makes them significantly faster than label-based edges. Use them whenever there is only one possible next step.

<div align="left"><figure><img src="/files/thyw3nQAmfdrTIeskj0V" alt=""><figcaption></figcaption></figure></div>

### Edge Conditions

Edge conditions allow you to trigger an edge **automatically** based on the value of an extracted or context variable, without relying on the AI to select it.

> **When to use conditions:** Use edge conditions when routing depends on a specific extracted> \
> or context variable value, such as a loan amount, age, or status. For regular conversational transitions, a label is sufficient. Once a variable is extracted, conditions are evaluated deterministically without involving the AI,> &#x20;making them faster than label-based edge selection.

#### Condition Operators

Each condition has a **left** value (usually an extracted variable name), an **operator**, and a **right** value to compare against.

Supported operators:

* `==` — equal to
* `!=` — not equal to
* `>` — greater than
* `<` — less than
* `>=` — greater than or equal to
* `<=` — less than or equal to
* `in` — value exists within a list
* `not in` — value does not exist within a list
* `contains` — value contains a substring
* `not contains` — value does not contain a substring
* `empty` — value is empty or not set
* `not empty` — value is present and not empty

#### Condition Groups

Conditions can be grouped using logical operators:

* **AND** — all conditions in the group must be true
* **OR** — at least one condition in the group must be true
* **XOR** — true when an odd number of conditions in the group are true
* **NOT** — inverts a condition

Groups can be nested to build complex routing logic.

#### Example

The following example routes a user to a senior agent when the requested loan amount exceeds 50,000:

<figure><img src="/files/EFkqHHB6iGgOqQEPLhmX" alt=""><figcaption></figcaption></figure>

### How Edges Are Selected at Runtime

At runtime, the system evaluates outgoing edges from the current node in the following order:

* **Always edges** are evaluated first — if an edge has the Always toggle enabled, it is taken immediately regardless of user input or any other edges.
* **Conditional edges** are evaluated next — if the condition resolves to true, the edge is taken automatically without involving the AI. If the condition resolves to false, the edge is never taken.
* **Label-based edges** are passed to the AI last, which selects the most appropriate one based on the label and the conversation context.

### Global Nodes

Nodes marked as **global** are implicitly reachable from any node in the pathway. You do not need to draw edges to them manually — the system makes them available at every step automatically.

### Best Practices

* Use clear, specific labels that describe the user's intent.
* Use edge conditions when routing depends on an extracted or context variable value — do not rely on the label alone for numeric or boolean routing.
* Avoid creating more conditions than necessary — simple label-based routing is sufficient for most conversational transitions.

### Advanced

Edge conditions support the full expressiveness of [Boolean Satisfiability (SAT) formulas](https://en.wikipedia.org/wiki/Boolean_satisfiability_problem). meaning any logical expression can be represented using AND, OR, XOR, and NOT groups.

This allows you to model complex routing logic such as:

* `(age > 18 OR status == "student") AND country == "US"`
* `NOT (loan_amount > 50000 AND credit_score < 600)`

<div align="left"><figure><img src="/files/sXr7ZNfXLNmxTyd4cXT9" alt=""><figcaption></figcaption></figure></div>

For most use cases, a single condition or a simple AND group is sufficient. The SAT support is there when your routing logic genuinely requires it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dataqueue.gitbook.io/voicehub-docs/agent-design-and-usage/pathway-edges.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
