Skip to content

How a turn works

Preview

Framework v2 is not yet available to all accounts.

A turn is one incoming message and everything Anychat does with it up to the reply. In v2 every turn walks the same seven stages, in the same order, and each stage leaves a line in the turn record. This page walks one of Mia's turns through them.

The person, midway through a conversation on RCS, writes: "Tuesday afternoon works. Can you book me with Dana?"

1. What comes in

The gateway receives the message from the channel and hands it to the agent with the channel it arrived on (RCS), the person it came from, and, if the person tapped something, what they tapped. A tap on a suggestion chip or a time picker arrives as a structured choice, not as text to interpret.

2. Checks that run first

Before the agent reads anything, the platform's pre-turn Policies run. Has this person opted out? Are we inside quiet hours for this channel? Is this a test conversation? If a Policy stops the turn, no reply is generated and the turn record says which Policy fired.

For our message, nothing fires.

3. What the agent reads

Anychat assembles the agent's reading for the turn.

  • The Brief: Identity, Personality, Guardrails, Objectives, the index of Playbooks, and the full body of the active Playbook.
  • Each used capability's "what this adds" text and, from it, this turn's facts: the Person record from People, the availability Dana has this week from Scheduling.
  • The channel line: RCS, rich, up to a certain number of suggestion chips, cards allowed.
  • The conversation so far, and a short running summary of it.

Each of these has a size budget. When something is too large to carry in full (a big product catalog), the agent gets a way to search it instead. The turn record lists everything assembled and how large it was.

4. Which Playbook is active

Anychat picks the Playbook for the turn from the index of when-to-use lines and the conversation summary. The person is booking; Book a consultation call is chosen. That Playbook carries a Flow, and the Flow is already in progress from the previous turn, at the step that collects a preferred time. If a different Playbook had fit better (a question about a treatment), the Flow would pause and resume after.

5. The agent decides and acts

Inside the Flow step, the agent's job is to read "Tuesday afternoon works" against the times Scheduling returned and fill in the preferred time. It matches Tuesday 2:00 pm with Dana. The Flow moves to its confirm step, and the agent phrases the confirmation.

In an open-ended Playbook this stage is wider: the agent may look something up in Knowledge, save a fact to the Person record, raise a notification, or call a custom integration, then write its reply with the results in hand. Actions happen inside the turn; the person sees only the final reply.

6. The reply is checked and shaped

The agent's reply is a filled-in form: one or more messages, each with text and, where the channel allows, suggestion chips, a card, or a reference to a message template. Post-turn Policies check it (a template goes out verbatim; a booking Policy confirms no cancellation happened without a clear ask; your own output checks run). Then the reply is rendered for the channel: on RCS, "Book Tuesday 2:00 pm with Dana?" with two chips, Yes, book it and Pick another time; on SMS, the same question as plain text with "Reply YES to confirm".

The person taps Yes, book it. On the next turn that tap fills the confirm step directly, the Flow books the call through Scheduling, sends the Booking confirmation template, records the outcome call booked, and returns to Welcome.

7. The turn record

Every turn is recorded and can be opened from the conversation in the console (Messages → the conversation's Inspect turns). It answers "why did it say that?" without guesswork:

Recorded Example from this turn
Policies that fired, before and after None before; none after
What the agent read Brief (Playbook: Book a consultation call), Person record, 6 available times, RCS channel line
Which Playbook was chosen and why Book a consultation call; Flow in progress at step 2
What the agent did Matched "Tuesday afternoon" to Tuesday 2:00 pm
The reply as the agent wrote it Confirmation text, two chips
The reply as sent, per channel RCS: text bubble plus chips
Time taken and cost 1.9 seconds

The Turn inspector opens from the Inspect turns action on a conversation in Messages and lists that conversation's turns in order, one card each. A card's title says what came in (a message, a tap, the conversation opening) and what the turn did; its chips and lines show the Playbook decision (and whether it switched, and why), whether the agent was called at all (a tap inside a Flow often needs no agent call), the actions it took, with a refused action flagged and the Policy that refused it, the Policies that fired, warnings, the Flow steps that ran, and how long the turn took. Raw trace under each card expands the full record. For an agent on the Generic runtime the inspector says so and shows nothing: only v2 turns are recorded.

The same record is what evaluations check and what the Copilot reads when you ask it about a conversation, and it is available through the API as the agent's turns. Records are kept for 90 days and then dropped; the conversation transcript itself is kept separately.

Agent-started conversations

When Mia starts a conversation (an outreach send), the first message is a reviewed template rendered with the person's details, and the conversation begins in the Playbook chosen for the send. Everything after that follows the seven stages above.