Skip to main content

Quick start: Create your first AI Procedure

You can build and test a working procedure in a few minutes. This example handles customers who can't make their appointment.

Step 1: Create the procedure

  1. Go to Chatbot → AI Chatbot → AI Procedures. If you have several AI agents, open the agent first.

  2. Click New procedure.

  3. Enter a Name, for example "Can't make my appointment".

  4. Under Type, keep Procedure. Choose Sub-procedure only for steps other procedures will call.

  5. Click Create. The editor opens.

The editor saves as you type. The header shows Saving…, then Saved.

Step 2: Say when to use it

Under When to use, add one bullet per situation, in your customers' words:

  • The customer can't make their appointment

  • The customer wants to cancel or move an appointment

Under When not to use (optional), add situations that look similar but shouldn't start it:

  • The customer wants to book a new appointment

By default the procedure runs on All channels. Pick specific channels to limit it.

Step 3: Write the instructions

Under Instructions, write one step per line in plain language:

Ask for their national ID number. Get their bookings. Ask them to pick the booking they mean. Ask if they want to keep it, cancel it, or move it. If they want to cancel it: cancel the booking, then end with "Your appointment is cancelled." Else if they want to move it: hand off to the Bookings Team. Else: end with "Great, see you then!"

When you leave a line, the editor checks it and adds what it will run as chips under it, marked Auto. For example, "Get their bookings" gets a chip for your bookings action, a Read action chip. "Write instructions in plain language" below explains how this works.

Step 4: Test it

  1. Click Test. The Test this procedure panel opens. It runs your latest draft, and nothing is sent to customers.

  2. Under Select a contact to test, pick a contact.

  3. Write a message as the customer, such as "I can't make my appointment tomorrow".

  4. Try each path: cancel, move, keep. Use Restart to start over.

Test and Publish stay unavailable while a line is marked in red, or a line has no step yet.

Step 5: Publish

Click Publish. The procedure goes live as version 1 and its status changes to Published · v1. From now on, conversations that match When to use follow it.

Write instructions in plain language

You write each instruction the way you'd explain it to a new team member, in English or Arabic. When you leave a line, the editor works out what it means and adds the action that will run, so you never have to build steps by hand.

Your words, and what runs

Every line has two parts:

  • Your words describe the step.

  • The Runs row under them shows what the agent will actually do, as chips.

Chips the editor adds have a dashed blue border and an Auto badge. Open a chip to review or change it. Once you save it, the Auto badge goes and it becomes your own. If you delete a chip, the line has no step, and Test and Publish wait until it has one. To only speak to the customer, use a Say chip.

You write

The editor adds

Ask for their order number.

Ask customer, saving the answer as @order_number

Ask if they want to keep it, cancel it, or move it.

Ask customer with the options Keep it / Cancel it / Move it

Ask them to pick the booking they mean.

Ask customer, picking from the list an earlier step saved, such as @bookings

Get their bookings.

Read action (the chip shows your action's name)

Cancel the booking they picked.

Write action, confirmed by the customer first

Get the order with that number.

Read action (the chip shows Get order by id and your store)

Check the shipping policy.

Look up content in the Knowledge Base

Work out how many days since the order.

Run code, with the code already written. Run Test code before you change it

Open a Refund Request ticket.

Create ticket of that type

Add the topic Complaint.

Add topic

Leave a note with the order number and the reason.

Add note

Hand off to Customer Service.

Hand off to a team

End with "Thanks, we're on it."

End with that closing message

Thank them for their patience.

Say: the line's own words are the message

Conditions in plain language

A line that describes a situation becomes an IF block:

  • "If the order is more than 30 days old, hand off to Order Management."

  • A following "Else if…" line adds another branch to the same block.

  • A line starting "Otherwise, …" right after an IF block becomes its ELSE branch.

  • "If the order isn't found…" or "If the coupon couldn't be generated…" checks whether an action failed. The editor sets that action to carry on when it fails, so your branch can run.

Lines that get split

  • Several open questions on one line become one question that collects each answer. A question with fixed options, or a pick from a list, is moved to its own line.

  • "Ask for their phone number, then get their orders with it" becomes the question plus a new line for the lookup.

  • Several actions on one line, such as "add the topic Complaint and hand off to Customer Service", each get their own chip.

Using / and @

  • Type / to insert an action yourself. The menu groups them as Flow, Data, Store (your connected store), Actions (your own connected actions, shown as you type a name) and Inbox.

  • Type @ to mention a variable, such as @order_number, or a file from your Media library.

When the editor needs your help

What you see

What it means

A red line with an error

The line can't run as written, for example "There's no team called “Support”." Every line after it stays locked until you fix it. Edit the line, then press Enter to check it again.

An amber warning

Part of the line isn't covered, for example "This step doesn't do “…”. Reword it, or split it into steps the builder can do."

"Nothing in the sentence gives …, so the agent will ask the customer for it."

An action needs a value nobody collected yet. For an action from your connected system, the agent asks the customer for it at that point. A store action needs the value collected on an earlier line.

A grey line: "This line has no step yet."

The check hasn't placed a step yet. Click Check again.

Test and Publish stay unavailable until no line is red or grey.

Paste a whole procedure

You can paste many lines at once. They're checked together and each gets its chips. If one line can't run, the lines after it wait until you fix it.

Generate with AI

A Generate with AI button sits beside Instructions. Describe the procedure in your own words, for example "Ask for the iqama id, find their bookings and let them pick one to cancel".

  • It writes the steps using only the actions, teams and variables your business has, or tells you what's missing.

  • If When to use and When not to use are both empty, the draft includes them too, and they're filled in when you insert it.

  • Review the draft, then click Insert (adds after your steps), Replace (shown when you already have steps) or Discard.

  • Ask for changes, such as "hand off when they have no bookings". Changes show as added and removed lines, and you choose Accept all or Reject all.

Did this answer your question?