Skip to content
QwryAI
Documentation
Pages

AI Agent Management

Procedures: step-by-step workflows for your AI agent

Give your agent a step-by-step process to follow whenever a conversation matches the trigger you describe

A Procedure is a standard operating procedure for one situation. It pairs a trigger, written as a sentence under When to trigger, with ordered Instructions your agent works through, including the Actions it calls along the way. Use Procedures for flows where you don't want your agent improvising, such as refunds, missing orders, cancellations and escalations.

Procedures run in conversations on every channel your agent answers on, unless you limit them with a Channel trigger. You build them in Build › Procedures.

When to use a Procedure

UseWhen
InstructionsThe rule applies to every conversation, such as tone, scope or topics to avoid.
An Action on its ownYour agent needs to do one thing, such as look up an order, and it's fine for it to decide when.
A ProcedureThe situation needs several steps in a set order, a check before acting, or a different path depending on the answer.

Reach for a Procedure when the order matters (look up the order before offering a refund), when there are eligibility rules (orders older than 30 days go to your team), or when an Action is sensitive. For sensitive Actions, also turn on Only use in Procedures, so the Action only runs as a step inside a Procedure. If one rule covers the case, such as "Share our returns page when customers ask about returns", keep it in your instructions.

Anatomy of a Procedure

Every Procedure has three parts:

FieldPurpose
NameA label for the Procedure, such as "Order not received", up to 100 characters. New Procedures start as Untitled Procedure.
When to triggerA sentence describing when this Procedure should start: the situation or request that routes the conversation here. Type / in it to add trigger chips.
InstructionsThe steps your agent follows. Steps can call Actions, send exact messages and branch on conditions.
Name, When to trigger and Instructions.

Triggers

Describe the situation in When to trigger in your own words, for example The customer says their order hasn't arrived. To start a Procedure in other ways, select Add trigger or type / in the sentence and pick a chip. Each chip's settings open as soon as you add it.

  • No reply: start when the customer hasn't answered an AI reply for the time you set.
  • Repeat: start again on a schedule until the customer replies. Add a No reply or API trigger first.
  • Schedule: start at set times, with no customer message.
  • API: start for one contact from your own systems, or for contacts you select on the Contacts page.
  • Start when a ticket is opened from a chat and Start when a chat's ticket is closed: start in the conversation when its support ticket opens, or closes and the AI is back in the chat.
  • Channel: only run on the channels you pick.
Add a trigger chip to the sentence.

Steps

Steps run in order, top to bottom. Write each one in plain language and press Enter for the next. There are three kinds:

  • Instruction steps: something your agent does, such as "Ask the customer for their order number".
  • Message steps: exact words your agent sends, with contact values filled in. Choose Message from the / menu.
  • Conditions: a decision point with an If branch, optional Else if branches and an optional Else. Choose Condition from the / menu. Your agent checks the conditions from the top, follows the first one that matches, then carries on after the condition.
Write a step in plain language.
Type / for a Condition or a Message.

Referencing Actions with @

Inside a step, type @ to pick an Action your agent should run at that point, for example Get order status. When your agent reaches that step, it calls the Action. To build an Action just for this Procedure, choose Create new AI Action.

Type @ to pick an Action.

Using variables with {{ }}

Personalize steps, messages and conditions with values filled in when the Procedure runs. Type {{ in a step to open the picker, which groups the values into:

GroupExamplesWhat it fills in
Contact attributesName, Email, Phone, External ID, CountryThe current contact's saved details
Conversation attributesChannel, Status, Assignee, PriorityDetails of the current conversation
Action outputsThe fields an earlier Action returnedA result from an Action called earlier in this Procedure
Type {{ to insert a contact value or an Action result.

Start from a template

Don't want to start from scratch? Open the Templates tab to browse ready-made Procedures, filter them by type, and select Preview to read one. Before you start lists anything the template needs, such as an integration to connect. Select Use this template to open an editable copy, then adjust its trigger and steps to your business.

Creating a Procedure

  1. Open Procedures

    Open your agent, select Build in the sidebar, then Procedures, and select Create Procedure. You can also start from a template.

    Create Procedure: describe the process and Qwry drafts it.
  2. Describe the process

    Under What should Qwry get done for your customers?, describe the process in your own words, or pick a suggestion such as Help a customer resolve a delayed delivery. Qwry drafts the name, trigger and steps for you to review.

    Describe the process in your own words.
  3. Review the trigger and steps

    Adjust the name, the When to trigger sentence and its chips, and the steps. Add Actions with @, values with {{, and conditions or messages with /. To change things in bulk, ask in Ask AI to update this Procedure and review the suggested changes. Try it in the Preview panel beside the editor.

  4. Save and publish

    Select Save. Saving puts your changes in your agent's draft: Draft saved. Published conversations are unchanged. Customers get the Procedure once you select Publish in the top-right corner. After that, the switch in the editor's header shows Live or Paused, and you can pause the Procedure at any time.

Managing Procedures

My Procedures shows each Procedure as a card with its trigger sentence, the number of blocks and when it was last saved. Filter by Live, Paused or Draft, or search by name. Each card has a switch to pause or turn it on, and a ⋯ menu with Edit, Duplicate, History (its save history) and Delete.

Examples

The examples below show steps in practice. The Action names are examples: type @ in a step to pick your own agent's Actions.

Order not received

This Procedure checks an order's tracking before promising anything, and sends late orders to your team as a ticket.

When to trigger: The customer says their order hasn't arrived.

Instructions:

Example conversation
1. Ask the customer for their order number and the email they ordered with.
2. Use @Get order status to find the order and its tracking.
3. If the order shipped more than 5 days ago and hasn't been delivered:
     Apologize, and use @Create ticket so the team can chase the carrier.
     Tell the customer the team will follow up by email.
   Else:
     Share the tracking link and the expected delivery date.
4. Thank the customer by name: {{Name}}.

Step 3 is a condition with an If and an Else branch, so every order goes down one of the two paths before step 4. To make sure tickets about late orders only open through this flow, turn on Only use in Procedures on the ticket Action.

Follow up when the customer goes quiet

This Procedure uses trigger chips instead of a customer message.

When to trigger: No reply for 30 minutes, then Repeat every day, 2 times in total.

Instructions:

Example conversation
1. Message: Hi {{Name}}, just checking in. Did you find what you were looking for?
2. If the customer replies with a new question:
     Answer it, then offer to help with anything else.

Because its triggers are No reply and Repeat, this Procedure only starts when the customer stops answering. It stops repeating as soon as they reply.

Frequently asked questions

How many steps can a Procedure have?

Up to 15, counting the steps inside conditions. A condition can have up to 5 branches, If and Else included, and conditions can't be nested.

Can two Procedures run at the same time?

No. Your agent follows one Procedure at a time: the one whose trigger best matches what the customer is asking for right now. It can switch to another Procedure on a later message if the customer asks for something else. To handle two things together, combine them into one Procedure with conditions. See How Procedures run.

Does a Procedure need to use Actions?

No. A step can be a plain instruction, such as "Ask the customer for their order number". Add Actions with @ only where your agent needs to look something up or make a change.

Why does my Procedure run on the website but not on WhatsApp?

Check for a Channel chip in When to trigger. With one, the Procedure only runs on the channels it lists. Also check that it's Live and published.

How many Procedures can be live?

4 on Free and Starter, 12 on Growth, and unlimited on Enterprise. Pause a live Procedure to turn on another one.

Next steps

Explore the documentation