> For the complete documentation index, see [llms.txt](https://docs.cekat.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cekat.ai/en/ai-and-platform/ai-agent/new-ai-agent-interface/ai-actions-and-routing.md).

# AI Actions & Routing

Set the AI's automatic actions: transferring to a human agent, applying labels, and moving pipelines.

The **AI Actions & Routing** tab controls **what the AI does** during a conversation, not how it speaks. This tab replaces **Agent Transfer Conditions**, **Label Conditions**, and **Pipeline Conditions** in the General tab of the old interface.

| Section                                         | Function                                                 | Previously                                  |
| ----------------------------------------------- | -------------------------------------------------------- | ------------------------------------------- |
| [Agent Transfer](#agent-transfer)               | Hands the conversation over from the AI to a human agent | One Agent Transfer Conditions prompt        |
| [Conversation Label](#conversation-label)       | Adds labels to a conversation automatically              | Label selection + one prompt for all labels |
| [Conversation Pipeline](#conversation-pipeline) | Moves a conversation to another pipeline automatically   | Pipeline selection + one prompt             |

![The AI Actions & Routing tab with its three sections](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FtucPFn5Lvr2hnojD0JrY%2F19-ai-actions-routing-overview.png?alt=media\&token=5f72b2ca-070c-42b0-977d-58343bc1a4fe)

{% hint style="info" %}
**Pending Status Messages** (messages to the customer while a conversation is pending) are not available in the new interface.
{% endhint %}

## How conditions work

Each rule is called a **condition**. Every condition has:

* **Title**: the name of the condition (required, up to 100 characters). New conditions are automatically titled *Condition 1*, *Condition 2*, and so on.
* **Trigger type**: when the condition counts as met.
* **Action**: what happens when the condition is met (depends on the section).

### Trigger types

| Trigger type          | How it works                                                                                                         | Example                                    |
| --------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------------------------------------ |
| **Prompt**            | The AI reads the conversation context and runs the action if the condition you wrote is met. Up to 1,000 characters. | "The customer has sent proof of transfer." |
| **Keywords**          | The action runs if the customer's message contains any of the keywords.                                              | `complaint`, `refund`, `human`             |
| **Number Of Message** | The action runs after the customer sends a set number of messages in a session. Enter a number from 1 to 9,999.      | After 10 messages                          |

![The trigger type options: Prompt, Keywords, and Number Of Message](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FKnaHHgmTQAAkJ5mmvB7Y%2F21-trigger-types.png?alt=media\&token=7d810069-4249-4015-a782-06a3b7f97e6c)

**Keywords details**

* Type a keyword, then press **Enter** or a **comma** to add it.
* Each keyword can be up to **20 characters**.

![A condition with the Keywords trigger and three keywords](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2Fh0NfdLZu1KCRIsXWGh4C%2F22-agent-transfer-keywords.png?alt=media\&token=a3005996-b574-4e29-b816-9775cd8c7ba0)

**Prompt details**

* Write the condition clearly and specifically.
* An **Optimize** button is available to help tidy up the prompt (it uses AI credits).

## Editing and saving

1. In the section you want, click the add condition button.
2. Change the title, choose a trigger type, then complete its settings.
3. Click **Save**. Every save creates a new version.
4. To delete a condition, click the delete icon, then confirm.

![The saved conditions summary](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FvAFOI5bzLrTjiMUqDYZL%2F27-routing-saved-summary.png?alt=media\&token=f766b98a-0c48-4549-a8ea-33dfc2a92aa8)

Before saving, Cekat checks every condition. If one is incomplete, a message such as *"Condition 1" needs at least one keyword* appears and the page is not saved until you complete it:

* A Prompt trigger must contain text and cannot exceed 1,000 characters.
* A Keywords trigger must have at least one keyword.
* A Conversation Label condition must have at least one label.
* A Conversation Pipeline condition must have a Target Pipeline.

This page also has a **Version History** that works the same way as in AI Behavior. See [Version History](https://docs.cekat.ai/en/ai-and-platform/ai-agent/new-ai-agent-interface/ai-behavior.md#version-history).

## Agent Transfer

Agent Transfer defines when the AI **hands the conversation over to a human agent**, for example when a customer wants to place an order, raise a complaint, or asks to speak to an admin.

* You can create up to **3 conditions**, **one for each trigger type** (Prompt, Keywords, Number Of Message).
* A trigger type that is already in use cannot be selected again. Delete that condition if you want to replace it.

![An Agent Transfer condition with the Prompt trigger](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FlmziRq5IRsRAR9Vz7SKq%2F20-agent-transfer-prompt.png?alt=media\&token=67a2cafd-c08b-421e-bc20-4ce69e1ebb93)

{% hint style="info" %}
What the AI does after a transfer (whether it stops replying, whether it tells the customer) is set in [AI Configuration](https://docs.cekat.ai/en/ai-and-platform/ai-agent/new-ai-agent-interface/ai-configuration.md).
{% endhint %}

## Conversation Label

Conversation Label makes the AI **add labels to a conversation automatically**, for example an "Interested" label when a customer shows buying interest, or a "Complaint" label when a customer is dissatisfied.

1. Add a condition in the Conversation Label section.
2. Change the condition title.
3. Choose a **trigger type** and complete its trigger.
4. Select one or more **labels** (required, up to **10 labels** per condition).

   ![Selecting labels for a Conversation Label condition](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FHfGVls3sjPXYvHHDQyJV%2F23-conversation-label-select-label.png?alt=media\&token=567a61a8-0714-4542-a2b0-9eb3866af25e)
5. Click **Save**.

![A completed Conversation Label condition](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FLteKKylkBdjedhgCSUJO%2F24-conversation-label-filled.png?alt=media\&token=a160d5cc-28ed-4031-8978-e07ef175a25f)

You can create up to **30 conditions** in this section. When a condition is met, the selected labels are added to the conversation.

## Conversation Pipeline

Conversation Pipeline makes the AI **move a conversation to another pipeline automatically**, for example from "New Leads" to "Ready to Pay" once the customer has confirmed their order.

1. Add a condition in the Conversation Pipeline section.
2. Change the condition title.
3. Choose a **trigger type** and complete its trigger.
4. (Optional) Choose **Current**, the source pipeline. If left empty, the condition applies from any pipeline.
5. Choose **Target**, the destination pipeline (required). The target must be different from the source pipeline.

   ![Choosing the Target pipeline](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2Fn4BSkg2mABDq4AI3ENzk%2F25-conversation-pipeline-select-target.png?alt=media\&token=bed568bf-c8af-4499-88a4-416727703648)
6. Click **Save**.

![A completed Conversation Pipeline condition](https://3748649913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzFvvakHJ5OVubOo4WKlR%2Fuploads%2FWR5QBBAROAAjn4NdJebx%2F26-conversation-pipeline-filled.png?alt=media\&token=88b828b1-4d1e-4a55-a571-561db4f19b94)

You can create up to **30 conditions** in this section.

## Tips

* Use **Keywords** for clear, definite requests (for example "human", "refund").
* Use **Prompt** for situations that need an understanding of context (for example "the customer seems upset").
* Use **Number Of Message** as a safeguard so very long conversations are still handled by a human.
* Test all your conditions with [Preview](https://docs.cekat.ai/en/ai-and-platform/ai-agent/new-ai-agent-interface/ai-behavior.md#preview) before using them with customers.
