Procedures
Step-by-step playbooks the agent follows when a conversation matches.
On this page
A procedure is a playbook: named steps the agent follows, in order, when a conversation matches its trigger. Use one when there is a right way to handle a situation, such as refunds, cancellations or complaints, and you do not want the agent to improvise.
Open an agent and select the Procedures tab.
The parts of a procedure
| Part | What it is |
|---|---|
| Name | For you, for example "Refund request" |
| When it applies | The trigger, described in plain words. The agent decides from this: "When the customer asks for their money back or a refund." |
| Steps | What to do, in order: Instruction steps and Branch steps |
| Active | Turn a procedure off with Deactivate without deleting it |
Instruction steps
One thing to do, in plain words. For example: "Ask for the order number."
Branch steps
A decision. Each condition has a when and a then; the first match wins. Otherwise covers everything else.
If the order was delivered more than 30 days ago
then explain that returns are accepted within 30 days, and stop.
Else if the item is damaged
then ask for a photo, then @hand_over to the team.
Otherwise explain how to send the item back.
Build one, step by step
Here is a refund procedure for a shop.
- Select Add procedure.
- Name:
Refund request. - When it applies: "When the customer asks for a refund or their money back."
- Add the steps:
- Instruction: "Ask for the order number."
- Instruction: "Use @order_status to look up the order."
- Branch:
- When "the order is older than 30 days", then "Explain that refunds are only possible within 30 days."
- Else if "the item arrived damaged", then "Apologise and use @hand_over so the team can arrange a replacement."
- Otherwise: "Explain how to return the item and that the refund follows within 5 days."
- Save, then test it in the Playground: "I want my money back for order KS-1042."
- 1Customer asks for a refund
- 2Agent starts "Refund request"
- 3Follows each stepasks, looks up, decides
- 4Marks it complete
Use actions with @
Type @ and an action's name, for example @order_status, to make the agent use that action at that step.
If a procedure names an action the agent does not have, or that is turned off, the procedure is skipped until fixed. The Procedures page shows which action is missing. Pair this with an action's Only in procedures setting, so a sensitive action is used only inside the procedure that checks things first.
Use variables with {{ }}
Variables let a step depend on the situation:
| Variable | Value |
|---|---|
{{agentAvailable}} | true while someone who can answer has the Inbox open |
{{withinBusinessHours}} | true within your business hours |
{{channel}} | Where the conversation is: widget, help_page, playground… |
{{verifiedUser}} | true when your site verified who the visitor is |
{{contact.<key>}} | One of the customer's contact attributes visible to agents, for example {{contact.plan}} |
Example branch: when "{{agentAvailable}} is true", then "use @hand_over"; otherwise "collect their email with @collect_lead and say we will reply tomorrow".
Variables are checked when you save, so a typo is caught straight away.
Limits and behaviour
- Up to 15 instruction steps and 5 conditions per branch. Branches cannot be nested; use another procedure instead.
- One procedure at a time per conversation.
- Each procedure shows triggered, pending and resolved counts. Many pending runs usually means a step the agent cannot finish; reword it.
Related
- ActionsLet the agent do things: call your API, collect leads, hand over to a person, show buttons.
- Contacts and leadsYour customers, the attributes you keep about them, and the leads agents collect.
- Test in the playgroundTry changes without saving, compare two models and inspect exactly what a reply was given.
Something not working as described here? See Troubleshooting.