Skip to navigation

Event Playbooks

Overview

An event Playbook 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.

EventWhen the Playbook runsExample
After the conversation endsAbout 60 seconds after the conversation endsWrite the conversation and its variables to your CRM.
When an end user submits a CSAT surveyAbout 60 seconds after the end user submits the surveyRecord a low score in your ticketing system for a follow-up.
A Playbook with a conversation start event runs in the live conversation, as the first response. See Conversation start events.

Limitations

Event Playbooks have the following limitations:

  • Playbooks only: Playbooks (Classic) and the Routing playbook cannot be event Playbooks.
  • One event for each Playbook: A Playbook 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, 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. 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 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.
  • IF/ELSE
  • GO TO
  • NOTE
  • RUN, with one of these targets only: an API tool, a Code tool, an MCP tool, a linked Playbook, or Exit Playbook

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

A linked 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 runs when the end user ends the chat, a voice call ends, your system ends the conversation with the Conversations API, or the conversation times out. See 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.
  • The end user does not match the audience of the Playbook.

Available variables

Steps in an event Playbook 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.
  • 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 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 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 or the MCP server.

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 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 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 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 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.