Skip to main content

The steps you can use in Procedures

Every step in a procedure is one of the actions below. Most are added for you from your words. You can also insert any of them with /, and open any chip to change its settings.

Action

What it does

Menu group

Say

Tells the customer something; the line's own words are the message

Flow

Ask customer

Asks a question and waits for the answer

Flow

Condition

Branches with IF / ELSE IF / ELSE

Flow

Hand off to a team

Escalates the conversation to a team

Flow

End

Resolves the conversation, optionally with a message

Flow

Run sub-procedure

Runs another procedure as one step

Flow

Read action

Fetches data from an integration

Data / Store / Actions

Write action

Changes data in an integration (always confirmed)

Data / Actions

Look up content

Searches the Knowledge Base

Data

Set variable

Stores a value, a variable, or the first item of a list

Data

Override variable

Gives a variable that already exists a new value

Data

Run code

Computes a value with a short Python snippet

Data

Add note

Leaves an internal note for your team

Inbox

Add topic

Adds one or more of your conversation topics

Inbox

Create ticket

Opens a ticket, filling its fields from values, variables or the customer's answers

Inbox

Create task

Opens a task on the conversation for your team

Inbox

Tag contact

Sets one of your contact tags on the customer

Inbox

Set contact attribute

Saves collected values to the customer's contact attributes

Inbox

Store actions appear under "Store · <your store>", and your own actions under "Actions" once you type part of their name. A line can hold only one Ask customer, End or Hand off chip, and nothing (no text, no other chip) may come after it.

Ask customer

  • Variable name: where the answer is saved. In free-text mode, + Add another variable lets one question collect several answers, which the customer can give in one message.

  • Answer type:

    • Free text, with a value type of text, number or date.

    • Pick from fixed options: one option per line. On WhatsApp the options show as a list to tap.

    • Pick from a list: the customer picks one record from a list variable, such as @bookings. Choose the Row title fields and Row subtitle fields to show.

  • Max attempts: how many times the question is asked before giving up. Default: 2.

  • If there is no answer: Hand off (default), End or Continue. A question the editor adds for an optional answer starts on Continue.

If the customer already said the answer outright since the procedure started, the question is skipped.

Read action and Write action

  • Action: the action to run. Store actions show the store's name after them, for example "Get order by id · Salla".

  • Inputs: one variable per input. Required inputs are marked with *. Leave a required input empty and the agent will ask the customer for it. Store actions need every required input filled.

  • Save result as: the variable that holds the result.

A Write action always asks the customer to confirm before it runs. If a Read or Write fails, the procedure hands off, unless a later condition checks for that failure.

Look up content

  • Query: what to search the Knowledge Base for.

  • Match threshold (0–1): how close an article must be. Default: 0.3.

  • Save result as.

Set variable and Override variable

  • Set variable stores a fixed value, another variable, or the first item of a list. Tick Remember for the whole session to keep it for later procedures in the same conversation.

  • Override variable gives an existing variable a new value, from another variable or a fixed value.

Add note

Write the note and mention variables, for example "Customer asked about order @order.number". Notes are internal: your team sees them in the inbox, and the customer never does.

Add topic

Pick from the topics your business already has. You create new topics in settings.

Create ticket

  • Ticket type. A type that needs an attachment can't be used, because the agent can't collect files.

  • Title: optional. Left empty, the ticket is named after its type.

  • Description, Starting status, Assignee team and Tags: optional.

  • Fields: required fields are always included. For each field, pick Ask the customer, Fixed value or From a variable.

  • Save result as: holds the created ticket, or an error you can branch on.

Create task

Task type, optional Title and Description, Assignee team, Tags, and Save result as.

Tag contact and Set contact attribute

  • Tag contact: one tag per group. Setting a tag replaces the contact's current tag in that group.

  • Set contact attribute: pick the attributes to save and where each value comes from. A value saved to a select attribute must match one of its options.

The editor doesn't add Set variable, Tag contact or Set contact attribute from your words. Insert them with /.

Hand off to a team

Pick the Team. The conversation goes to that team, and the procedure stops.

End

Closing message: optional. Mention variables with @.

Run sub-procedure

Pick a published Sub-procedure and fill its Inputs. Its outputs are listed as "Produces: …". See "Sub-procedures" below.

Conditions and Run code

Conditions send customers down different paths. Run code works out exact values those conditions, or later steps, can rely on.

How a condition looks

A condition is an IF block with one or more branches:

  • IF the first case

  • ELSE IF another case (as many as you need)

  • ELSE everything else

Each branch holds its own steps, numbered 1., 2., … inside it. Use the + menu on the condition to Add else if, Add else or Remove condition.

Without an ELSE, a customer who matches no branch carries on with the next step after the block. The condition shows: "Otherwise, continue with the next step."

Two ways to judge a branch

Use the picker at the end of a branch's condition field, which shows Natural language or Code, to choose how the branch is judged:

Mode

How it decides

Example

Natural language

The AI judges the sentence

All bookings are cancelled

Code

A Python expression, true or false

len(bookings) == 0

Natural language is easiest. When the AI can't tell yet, it asks the customer one short question, and hands off if it still can't tell. Use Code when the answer must be exact.

Rules for conditions

  • A condition can't sit inside another condition's branch. To check two things, write them as one condition ("If the order is delivered and older than 14 days…"), or as separate conditions one after another.

  • A procedure must never leave the customer with nothing next. Every route must reach an End or a Hand off, or Test and Publish show: "the workflow can run out of steps here". Make sure every branch, and the ELSE, ends with End or Hand off, or is followed by steps that do.

  • To handle a failed action, add a branch such as "If the order isn't found…". That action then carries on when it fails, instead of handing off.

Run code

Run code computes a value with a short Python snippet. Use it for dates, totals, counts and filtered lists.

Open the chip and click Open editor. In the Python code editor:

  1. Click Generate with AI and describe what to work out, for example "count the cancelled bookings". Click Write code. It writes code that already passes the check and shows the result on sample values.

  2. Or write it yourself. Use Insert variable to read a variable. The last line must return a value.

  3. Choose the Result type: Not typed (the default), Number, Text, Date, Yes / no, One of a list, or, when records are in scope, a list of them or one of them, such as List of bookings.

  4. Click Test code with sample values. You can save only after the current code has passed a test run. Changing the result type means testing again.

  5. Set Save result as, then click Done.

To offer the result as a pick list, set the result type to a list of records, such as a list of bookings. Then point the question's List at that variable.

What code can use

  • Variables collected above it, by name. @customer and @system values are available too.

  • These modules only: math, decimal, re, datetime, datetime.timezone, json, random, time.

  • Code runs for at most 5 seconds and can't call the internet, read files or run actions.

If the code fails while a customer is in the procedure, its result holds an error and the procedure carries on. A Code condition that fails stops the procedure and hands off.

Sub-procedures

A sub-procedure is a set of steps you write once and run from any procedure, such as "Verify the customer" or "Collect delivery details". Customers never start a sub-procedure directly. A procedure runs it as one step, then carries on.

Create a sub-procedure

  1. In AI Procedures, open the Sub-procedures tab and click New procedure. Or choose Sub-procedure under Type in the create dialog.

  2. Fill in Inputs: what a caller must provide when it runs this sub-procedure. Click Add and give each a Name and Type (text by default). Required is ticked; untick it for an optional input.

  3. Write the Instructions as for any procedure. Inputs are available with @.

  4. Fill in Outputs: the variables handed back to the caller. Each output must be produced by a step.

  5. Click Publish.

A sub-procedure has no When to use, no channels and no Test button. You test it through a procedure that calls it.

It doesn't need to end with End or Hand off: when its steps finish, the calling procedure continues. It can still hand off or end the conversation itself.

Run it from a procedure

Write a line such as "Run the Verify customer sub-procedure", or insert Run sub-procedure from the Flow group of the / menu.

  • Sub-procedure: only published sub-procedures are listed, shown as "Name (vN)".

  • Inputs: pick a variable for each input. Required inputs are marked with *.

  • Produces: the outputs you can use in later steps.

Sub-procedure rules

  • Publish the sub-procedure before any procedure can call it.

  • A sub-procedure can't call itself, and a chain of calls can't loop back to the procedure that started it.

  • A procedure plus the sub-procedures it calls can be at most 5 levels deep.

  • While a published procedure still calls a sub-procedure, you can't unpublish or delete it. The message lists those procedures, each with an Open link: remove the call from them and publish them, then try again.

  • When you publish a new version of a sub-procedure, every procedure that calls it runs the new version from then on. You don't need to republish the callers.

Did this answer your question?