> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# Event Playbooks

## Overview

An event [Playbook](/docs/automation/playbooks) runs in the background after an event. It sends no messages and asks no questions. Use it to send the variables of a conversation and its CSAT survey answers to your own systems, for example a CRM.

| Event                                      | When the Playbook runs                                 | Example                                                      |
| :----------------------------------------- | :----------------------------------------------------- | :----------------------------------------------------------- |
| **After the conversation ends**            | About 60 seconds after the conversation ends           | Write the conversation and its variables to your CRM.        |
| **When an end user submits a CSAT survey** | About 60 seconds after the end user submits the survey | Record a low score in your ticketing system for a follow-up. |

> **Note**
>
> A Playbook with a conversation start event runs in the live conversation, as the first response. See [Conversation start events](/docs/automation/playbooks/configure#conversation-start-events).

## Limitations

Event Playbooks have the following limitations:

* **Playbooks only**: [Playbooks (Classic)](/docs/automation/playbooks/playbooks-classic) and the [Routing playbook](/docs/channels/voice/dialpad-voice#set-up-teams-consult-and-conference) cannot be event Playbooks.
* **One event for each Playbook**: A [Playbook](/docs/automation/playbooks) can have one of these two events, and each event can run one Playbook.
* **Inactive only**: An event Playbook stays inactive. The AI Agent does not start it in a live conversation.
* **Tool inputs from variables only**: No end user is there to give a value. In an API tool, insert the variables in the URL, headers or body, and add no inputs. In a [Code tool](/docs/automation/tools/code-tools/inputs-outputs-and-environment), link each input to a variable. An input whose variable has no value reaches the code as `None`. The Playbook stops at a tool input that is not linked to a variable, and at an MCP tool that asks for a confirmation.
* **No customer login Tokens**: An event Playbook cannot use a [customer login Token](/docs/automation/tools/api-tools/token-configuration). Use tools that authenticate with your own credentials.
* **No retries**: If a step fails, the Playbook does not try it again.
* **No survey type**: No variable tells the Playbook whether the end user answered the AI Agent survey or the **Human Agent** survey.

## Capabilities & configuration

The event sets when an event Playbook runs. The allowed steps set what it can do.

### Allowed steps

An event [Playbook](/docs/automation/playbooks) can contain only steps that do not involve the end user or a human agent:

* `SET`, except a `SET` step on `csat_score`. A `SET` step cannot search [Knowledge](/docs/knowledge).
* `IF/ELSE`
* `GO TO`
* `NOTE`
* `RUN`, with one of these targets only: an API tool, a Code tool, an MCP tool, a [linked Playbook](/docs/automation/playbooks/configure#link-a-playbook), or **Exit Playbook**

The editor shows an error on each step that is not allowed.

> **Warning**
>
> A [linked Playbook](/docs/automation/playbooks/configure#link-a-playbook) that an event Playbook runs can contain only these steps too. If you add a step that is not allowed to a linked Playbook, the event Playbook does not run until you remove that step.

### When an event Playbook runs

Each event starts the Playbook at a different point:

**After the conversation ends**: The [Playbook](/docs/automation/playbooks) runs when the end user ends the chat, a voice call ends, your system ends the conversation with the [Conversations API](/reference/conversations/overview), or the conversation times out. See [Conversation timeouts](/docs/optimization/conversations/conversation-identifiers-and-persistence#conversation-timeouts).

**When an end user submits a CSAT survey**: The conversation can be open or ended. Each submission starts a run, including a **Human Agent** survey. If the end user submits the same survey again before the run starts, only the latest submission runs.

An event Playbook does not run in these cases:

* The end user sent no message in the conversation. This case applies to **After the conversation ends** only.
* The conversation is in [Simulations](/docs/optimization/testing/simulations).
* The end user does not match the [audience](/docs/automation/audiences) of the Playbook.

### Available variables

Steps in an event [Playbook](/docs/automation/playbooks) can read these values:

* **Variables**: The latest value of each variable that the conversation set before the event.
* **Identifiers**: `conversation_id`, `chatter_id`, `end_user_id`, and `channel`. See [Conversation identifiers and persistence](/docs/optimization/conversations/conversation-identifiers-and-persistence).
* **Transcript**: `ada_conversation_transcript` holds the transcript when the Playbook starts. If the transcript is longer than 30,000 characters, the variable keeps the latest messages.
* **Survey answers**: In a **When an end user submits a CSAT survey** Playbook, [`csat_score`](/docs/automation/variables/using-variables#metavariables) holds the score of that survey, from 1 to 5, if the end user gave one. In an **After the conversation ends** Playbook, the survey variables are empty.

## Implementation & usage

### Assign an event

Assign an event so that the [Playbook](/docs/automation/playbooks) runs after that event. Before you start, save the Playbook and clear **Only available within other Playbooks**. Otherwise, the editor does not show the events.

**To assign an event to a Playbook:**

1. Go to **Config > Playbooks** and open the Playbook.
2. If **Active** is enabled, disable it.
3. Select the **Playbook Details** pane.
4. In the **When to use this Playbook** field, type `@`.
5. Select **After the conversation ends** or **When an end user submits a CSAT survey**.

   The event appears as a pill above the description field. If another Playbook has the event, saving moves the event to this Playbook, and the other Playbook stops running for that event.
6. Click **Save**.

While the Playbook has the event, the **Active** toggle is locked, **Test Playbook** is not available, and the **Add instruction** menu shows only the allowed steps.

**To remove an event from a Playbook:**

1. Open the Playbook and select the **Playbook Details** pane.
2. On the event pill, click the remove icon.
3. Click **Save**.

You can also show, assign, and remove events with [adacli](/adacli/overview) or the [MCP server](/mcp/introduction/overview).

### Test an event Playbook

Use **Test Playbook** to test the steps before you assign the event, because real conversations run the Playbook as soon as you save the event. After you assign the event, use **Test AI Agent**. The event [Playbook](/docs/automation/playbooks) stays inactive, and it runs when the event occurs in the test chat.

**To test an event Playbook:**

1. Assign the event and save the Playbook.
2. In the **Config** sidebar, click **Test AI Agent** and start a chat.

   If the Playbook has an audience, [import that audience](/docs/automation/audiences#test-as-an-audience) in the test chat.
3. Send at least one message as the end user.
4. Click **End Chat**, and confirm.

   If the CSAT survey is enabled, it shows before the conversation ends. To test **When an end user submits a CSAT survey**, submit the survey. To test **After the conversation ends** only, click **Skip and close**.
5. Wait at least 2 minutes.
6. Go to **Convos**, select the **Include test users** view, and open the conversation.

   The [reasoning log](/docs/optimization/conversations/response-training#reasoning-log) shows the steps and tool calls of the event Playbook.
7. Confirm that your system has the record.

## Best practices

The two events have no fixed sequence, and an event [Playbook](/docs/automation/playbooks) can run more than one time for a conversation. Keep one correct record for each conversation in your system:

* **Send the conversation ID**: Send `conversation_id` in each tool call.
* **Keep one record**: Set up your API to create the record if it does not exist, and to update it if it exists.
* **Update only the fields for each event**: Set up the **When an end user submits a CSAT survey** Playbook to write the survey fields, and the **After the conversation ends** Playbook to write the conversation fields.

## Related features

* [Configure](/docs/automation/playbooks/configure): The Playbook editor and conversation start events.
* [Step reference](/docs/automation/playbooks/step-reference): Each step type and `RUN` target.
* [CSAT survey](/docs/optimization/performance/csat-survey): The survey and its settings.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).