Chat Procedures
A procedure is a step-by-step flow your messenger's AI agent follows for requests that need more than an answer: cancelling an order, issuing a refund, starting a return or changing a booking. It asks the customer for details, looks things up in your systems, checks what it found, and makes a change only after the customer says yes.
Procedures, rules and actions
| Feature | What it's for |
|---|---|
| Question rules | One response to a kind of question: hand off, reply with set text, guide the AI's answer, show a button or call an action. |
| Actions | Connections to your own systems, such as looking up an order or cancelling a subscription. Actions that look something up can be used by the AI while it answers. |
| Procedures | A whole flow made of steps, using your actions in a fixed order. The only way an action that changes something can run. |
Docent walks the steps one at a time. The AI only reads details out of what the customer wrote, picks among options you list and writes the wording. It never chooses the next step and can never make a change by itself.
Open the Procedures page
- In the account sidebar, click Messengers and open your messenger.
- In the messenger's sidebar, click Procedures (under Actions). Owners and Admins can see it.
- The page lists your procedures with when each starts, its number of steps, its runs in the last 30 days and whether it's on. Click one to open it in the designer, or click New procedure.
New procedure offers templates you can adapt: Cancel an order, Order status, Report an issue, Start a return, Change a delivery address, Cancel a subscription, Refund within 30 days and Change a booking, or Start from scratch. A template's Look up and Do steps need to be pointed at your own actions before it can be switched on.
Using the designer
- Add a step: drag a step from the palette onto a + in the flow, or click a + and choose one. Steps connect where you drop them, and the flow arranges itself.
- Branches: steps such as Confirm, Check, Look up, Do and Decide split the flow (Yes/No, Success/Failed, or one branch per option). Add steps under each branch.
- Edit a step: click it to open its properties in the panel on the right.
- Undo and redo: Ctrl+Z and Ctrl+Y. Copy and paste: Ctrl+C and Ctrl+V. Delete removes the selected step.
- Zoom: the + and − buttons or Ctrl+scroll. Drag the background to move around.
- Issues: problems are listed in the panel and marked on the steps as you work. Red ones stop the procedure being switched on; amber ones are worth fixing.
Step types
| Step | What it does |
|---|---|
| Ask | Asks for details: a form on the website, questions in words on WhatsApp and email. Each answer is kept as a value, such as {{order_number}}. Details already in the customer's messages are picked up. Always show the question (on by default) still shows the website form, filled in, so the customer can check it. If they won't say chooses what happens after up to 3 tries. |
| Say | Sends a message. |
| Confirm | Asks a yes/no question with two buttons. Yes allows one change by a Do step below it. An unclear reply is asked once more, then counts as no. |
| Write up | The AI writes a short, neutral summary of the issue from the conversation, kept as {{summary}}. Show it with a Confirm and send it with a Hand off. |
| Look up | Calls an action that looks something up and keeps the result (for example as order, then {{order.status}}). Continues on Success or Failed. |
| Do | Calls an action that changes something, only after a Confirm's Yes. Continues on Success or Failed. |
| Check | Compares values (is, is not, contains, more than, at most, is empty…) and continues on Yes or No. Numbers compare as numbers and dates as dates. |
| Set | Works out a value: text with values in it, or a Calculate using + − * / %, round, floor, ceil, abs, min, max, days_since and days_until. |
| Decide | The AI reads the conversation and picks one of your options (for example, why they want a refund). Each option is a branch, plus Something else. |
| Go to | Jumps to another step, to join paths or loop back. A loop must include an Ask or a Confirm. |
| AI answers | Ends the procedure and lets the AI answer the question that started it from your articles, with your guidance and everything the procedure found out. |
| Hand off | Ends the procedure and brings in your team (a chosen team, or the usual one) with a note of everything it found out. It can also email the customer a copy. |
| End | Ends the procedure, with an optional message. With no message it finishes quietly. |
An empty branch has a default, shown on the canvas: a Failed call hands off, a declined Confirm says nothing was changed, and anything else ends. If a path runs out without saying anything, the AI answers the customer's message with what the procedure found out.
Messages the customer reads (Say, Confirm, End, Hand off, an Ask's introduction and the emailed copy) can be formatted with bold, italics, links and lists, using the bar above the box or Markdown such as **bold**. Click Preview to see it as the customer will. It shows formatted in the messenger and in email; WhatsApp gets its own bold and italics, with links written out.
How a procedure starts
Click the Starts when block at the top of the flow and choose:
- When a message matches: the AI starts it when what the customer asks matches your description (for example "Wants to cancel an order"), judged by meaning, like a question rule.
- When a new conversation starts: it runs on the first message of every new conversation on the channels you tick (Web chat, Email, WhatsApp), before anything else answers. Use it to sort incoming mail: a Decide step reads what the email is about, then each option hands it to the right team, answers it or carries on. On email you can pick single addresses. If two procedures start on the same channel, only the first in the list runs, and the designer warns you.
Procedures only run where the AI answers, so not on an email address whose AI replies are off.
Values and formats
Put values in messages and step settings with double braces. The properties panel lists the values available at each step; click one to insert it.
| Value | What it holds |
|---|---|
{{order_number}} | An answer from an Ask step, named after its field. |
{{order.status}} | A field in a Look up result kept as order. |
{{customer.name}}, {{customer.email}}, {{customer.phone}} | The customer's details. |
{{customer.user_id}} | The signed-in user's ID, for verified customers only. |
{{attributes.plan}} | An attribute your website sent when it started the messenger. |
{{today}} | Today's date. |
{{question}} | The customer's question that started the procedure. |
Add a format after a bar to change how a value shows in a message: {{total | number}} → 1,600, {{total | money}} → 1,600.00, {{total | whole}} → 1,600 rounded, and upper or lower to change the case of text.
Safety rules
- A Do step needs a Confirm's Yes before it on every path that reaches it. Each Yes allows one change.
- Look up steps use actions that look something up; Do steps use actions that change something. On the Actions page, an action marked Changes something is never given to the AI to call by itself: only a procedure's Do step runs it.
- Only in procedures: mark a look-up action this way when its results need details collected and checked first, such as a price quote. The AI never calls it by itself; only a Look up step runs it.
- A procedure that would loop forever, or reaches a step that's been deleted, hands off to your team.
Running a Do step's action from the Actions page calls your real system, so the change really happens. Use test values.
When a procedure runs, and when it stops
- Each procedure runs at most once in a conversation. A follow-up question is answered as usual instead of starting it again.
- If the customer asks for a person at any point, the procedure stops and your team takes over, with a note of everything it found out.
- Procedures are for the AI only. Once someone on your team has been in a conversation (taken it over, been assigned it or replied), a procedure under way stops and none runs there again, even after the conversation is closed, handed back to the AI or reopened.
Trying it out
Click Try it in the designer to play the customer, turn by turn, saved or not. The path lights up on the canvas as it runs. Do steps always use the action's sample response, and Look up steps do too unless an admin ticks Call Look up actions for real. Nothing is sent, saved or billed. Saved procedures can also be tried on the messenger's Test page; see Testing the chat AI.
What your team sees in the inbox
- In the conversation: each run's messages sit together in a box headed PROCEDURE with its name, when it started and a bar showing the steps taken. Each step's message has its number and name above it, with the buttons it offered underneath. The last line says how it ended: Running, Completed, Stopped here, or stopped when a teammate took over. A finished run with more than six messages folds up.
- In the details panel: the Procedures card shows each run with the step it's at (Running, Completed or Stopped here) and What it found out, such as the order it looked up. Click Hide to fold that list away.
- View path ↗ (Owners and Admins) opens the procedure in the designer with the run's path lit up.
Internal notes in the conversation also record each look-up and change. For more about the conversation view, see Using the chat inbox.
Measuring procedures
- Traffic in the designer shows the last 30 days on each step: how many runs reached it, ended there or are waiting there now.
- Reports → AI agent has a procedures table: for each procedure, its runs, how many finished, were handed off or stopped, and the step most unfinished runs stopped at. See Chat reports.
A procedure that finishes after a successful Do step counts as an AI resolution, billed only if the customer doesn't then need a person. One that ends in AI answers is billed like any answer. Hand-offs, stopped runs and test chats never count.