# Routing Patterns

Routing logic is conceptually declarative, and many teams model it in YAML for version control, portability, and CI/CD, then map it into iX Hello flows, intents, or agent configurations.

#### Simple Routing

This routes the user to different handlers based only on intent, with a fallback.

Most nodes just go to the next node:  &#x20;

```
    - greeting:    
        type: say    
        message: Welcome!    
        next: main_agent
```

#### Conditional Routing

Conditional routing sends a user to a specific flow only when certain conditions are true (intent, confidence, user data, channel, etc.).

Use goals for branching based on agent analysis:

```
- check_result:    
        type: agent    
        preset: processor    
        system: Check if the balance is positive or negative.    
        goals:    
          positive:    
            description: Balance is positive    
            next: good_standing    
          negative:    
            description: Balance is negative    
            next: payment_needed    
          unknown:    
            description: Unable to determine    
            next: manual_review    
```

#### Chained Say Nodes

Chained Say Nodes are multiple “Say” (message) steps executed one after another before moving to a decision, input, action, or routing step.

String multiple messages together:

```
- introduction:    
        type: say    
        message:    
          - Welcome to our service.    
          - This call may be recorded.    
          - Press 1 for sales, 2 for support.    
        next: main_menu    
```

#### Routing Through Say Nodes

A Say node delivers a message and immediately routes the conversation to another node/flow based on a rule—without waiting for user input.

To say something before routing, use a dedicated say node:

```
- handle_api:    
        type: api    
        # ...    
        exits:    
          success:    
            next: next_step    
          failure:    
            next: api_error_message    
         
    - api_error_message:    
        type: say    
        message: Something went wrong. Let me try again.    
        next: retry_step    
```


---

# 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://docs.ixhello.com/ixhc2/technical-specifications/yflow-a-yaml-based-conversational-flow-language/routing-patterns.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.
