## Overview

Until now, a service script could only be written as **text** in the bot's persona or instructions:
"qualify first, then present the proposal, only then close". Text is guidance — a model may follow it
or ignore it, and the cheaper, faster models usually ignore it by the third turn. Worse: there was
**no state** saying "this conversation is at the qualification step", so nothing could even **notice**
the drift, let alone correct it.

The **Service sequence** replaces that text with structure:

- the service becomes an **ordered list of steps**;
- each step has a **goal**, the **tools it allows** and an **exit criterion**;
- the criterion is checked **by the platform**, in code, against what the turn **actually
  executed** — never by asking the bot whether it is done.

That inversion is the entire feature. A bot that says *"I've already saved your details"* without the
tool having run **advances nothing**.

> **It is optional and ships off.** A bot that never opens this section behaves exactly as before —
> same instructions, same tools, same cost. Nothing is added to the conversation.

## Prerequisites

- **Maestro enabled** and a configured bot.
- **Administrator** permission to edit the bot's configuration.
- The **tools** you want to use in the steps must already be **enabled on the bot**. A step can only
  **narrow down** the tools the bot has — never add to them.
- For the **Contact fields filled in** criterion: the fields you will require must exist on the
  contact record and be fillable (by a bot tool, by an automation or by the team).

## Step by step

1. Open the bot's configuration and go to **Service sequence**.
2. Turn on **Follow a sequence of steps**.
3. Click **Add step** and fill in:
   - **Step name** — in your own words. The system never translates or rewrites it; the identifier
     below the name is generated from it.
   - **Goal** — goes to the top of the instructions while the step is active.
   - **Tools allowed in this step** — pick from the ones the bot already has.
   - **Exit criterion** — see the table below.
   - **Turn limit for this step** — the safety net (default 8, minimum 1).
4. Repeat for the remaining steps. **The order of the list is the order of the service**: use *move
   up* and *move down*. Each step leads into the next automatically — you never type the link.
5. Choose **After the last step**: hand over to a human, mark as resolved, or keep talking with no
   step.
6. Decide whether to **Restrict to the step's tools**.
7. Save.

> **On with no steps does not count.** The form warns you and asks for at least one step, or for the
> option to be turned off. Even if it is forced through, a sequence with no steps is inert: the bot
> works as it always has.

## Settings & options

### The four exit criteria

| Criterion | The step ends when… | Use it when |
|---|---|---|
| **Tools executed** (default) | the chosen tools **actually ran** in that turn | there is a concrete action that proves the step (booking, charging, recording) |
| **Contact fields filled in** | **every** field you listed is filled in on the contact | the step exists to **collect information** |
| **Only when a human moves it on** | nothing automatic advances it — read the limits section | you want a **human check** mid-service |
| **After a number of turns** | the step's turn limit is reached | there is nothing objective to check (an opening, a greeting) |

Details that change the outcome:

- **Tools executed with an explicit list** (the *Tools that prove the exit* field) requires **all**
  the listed tools.
- **Tools executed without an explicit list** accepts **any one** of the tools allowed in the step —
  so you do not have to restate the list twice.
- **A step with no tools and no list** is a pacing step: it ends as soon as the turn completes.
- **Contact fields filled in**: if the contact lookup does not happen or fails, the step **waits**
  instead of advancing. Advancing on absent evidence is exactly what this feature exists to prevent —
  and the turn limit still bounds the wait.

### The turn limit: always present, and always an escalation

The limit counts **turns** (contact messages served), not the model's internal attempts. It exists
because "the bot asked me the same thing eight times" is the real problem.

When the limit runs out **without the criterion being met**, the sequence **ends there** and applies
the *After the last step* policy — as an **escalation**, not as a completion. The step is **not**
recorded as done, and the next step is **not** started.

### After the last step

| Option | What happens |
|---|---|
| **Hand over to a human** | the conversation is handed over through the same path as the bot's normal handoff: internal note, status and team assignment |
| **Mark as resolved** | the conversation is closed **after** the reply is delivered — never on top of a message the contact has not received |
| **Keep talking with no step** | the bot carries on serving, now with no step restriction at all |

### Restrict to the step's tools

- **On** (default): the bot **never even receives** the other tools. Leaving the step becomes
  impossible, not merely discouraged.
- **Off**: the step **guides** through its goal, but does not stop the bot from using any tool it has.

Even with the restriction on, a minimum set is **never removed**: reading the contact and the
conversation, and **handing over to a human**. A step whose author forgot the handoff would produce a
conversation that **cannot reach a person** — worse than the problem the restriction solves. And
withholding the contact record makes the model **guess** facts it could have looked up.

### What the bot sees of the sequence

Only the **current step** reaches the instructions — never the whole roadmap. A model handed the full
map starts narrating it to the contact ("now we move on to the proposal step") or skipping to a step
it read about, which is the opposite of following it.

The **name** and the **goal** reach the bot **exactly as you wrote them**, in your language, with no
translation and no rewriting.

## Use cases

- **Sales**: Qualification (contact fields) → Proposal (quote tool executed) → Closing (charge
  created) → *hand over to a human*.
- **Triage before a human**: a single step, goal "find out the topic and the urgency", exit on
  contact fields, a 5-turn limit and **hand over** as the exit policy.
- **Onboarding**: several collection steps, each requiring different contact fields, and *mark as
  resolved* at the end.
- **Human check mid-service**: a step with a **manual** exit and a short turn limit, so the
  conversation escalates to the team when it gets there (read the limits below before using it).
- **Support with a fixed procedure**: tool restriction on, so the bot cannot create a charge during
  the diagnosis step.

## Tips, limits & best practices

> **"Only when a human moves it on" has no advance button.** Today **nothing** advances a manual step
> automatically, and there is no command in the panel to push it to the next one. In practice it ends
> in one of two ways: the **turn limit** runs out and the sequence closes through the exit policy (an
> escalation), or **a person takes over the conversation** — at which point the bot has stopped
> replying anyway. Use this criterion as **"stop here and call someone"**, with a short turn limit and
> *Hand over to a human* as the exit policy. Do not use it expecting the conversation to carry on to
> the next step afterwards.

Other limits, equally honest:

- **A criterion with nothing to check becomes an escalation.** If you pick *Tools executed* with no
  tools, or *Contact fields* with no fields, the form warns you: that step would only ever exit on the
  turn limit — which is an escalation, not a completion.
- **Only tools already enabled on the bot can enter a step.** If the list comes up empty, enable the
  tools in the **Tools** section first.
- **Turning it off does not delete anything.** The steps stay saved; the form tells you how many.
- **The step is durable.** It survives a pause, a handoff, a restart and a contact who answers six
  hours later. A returning contact does **not** start over.
- **Editing the sequence while conversations are live has a consequence.** If you **delete or rename**
  the step a conversation is sitting on, that conversation is **released** — it finishes
  unconstrained, as it did before the sequence existed. It is not restarted at step 1, so the contact
  does not pay for your edit by answering everything again.
- **The form refuses a sequence that cannot be walked**: a step with no name, two steps sharing an
  identifier, a link pointing at a step that does not exist, or a cycle.
- **This does not replace reply verification.** One stops the bot from **advancing** without proof;
  the other stops it from **telling the contact** something that did not happen. They add up.

Best practices:

- Start with **two or three steps**. An eight-step script is easier to get wrong than to follow.
- Prefer **Tools executed** whenever there is a concrete action: it is the hardest criterion to fake.
- Write the **goal** as a task sentence ("find out the segment and the company size"), not as a
  persona.
- Keep the **turn limit** short on the opening steps and roomier on the ones that depend on the
  contact answering something slow.
- For sensitive actions (money, cancellation, personal data), combine the sequence with **human
  approval**.

## Troubleshooting

- **"I can't save"**: the sequence is on with no steps, or there is a step with no name, two sharing
  an identifier, a broken link or a cycle. The form's message says which one it is.
- **"The step's tool list is empty"**: the bot has no tools enabled yet. Enable them in the **Tools**
  section and come back.
- **"The bot won't leave the first step"**: the criterion is not genuinely being met. Check that the
  required tool **ran** (and was not merely mentioned in the reply) and that the required fields are
  actually filled in on the contact. A disabled tool never runs.
- **"The conversation was handed over mid-script"**: some step ran out of turns. That is the
  escalation working — raise that step's limit or make the criterion easier to meet.
- **"The bot told the customer the script"**: it never receives the script, only the current step. If
  the script text is showing up, it was most likely also written into the **instructions** or the
  **persona** — remove it from there.
- **"I reordered the steps and an old conversation went odd"**: live conversations keep the state they
  already had. If the step they were on is gone, they were released and finish unconstrained.
- **"I turned the sequence off and the steps disappeared from the screen"**: they are still saved —
  the notice tells you how many steps are being kept.

## See also

- [Maestro tools by module](/hc/ajuda/articles/maestro-brain-ferramentas-maestro-por-modulo-en)
- [Bot autonomy modes and human approval (HITL)](/hc/ajuda/articles/maestro-brain-autonomia-e-aprovacao-humana-en)
- [Verifying what the bot claims before sending](/hc/ajuda/articles/maestro-brain-verificacao-do-que-o-robo-afirma-en)
- [Turn verification and holding the reply](/hc/ajuda/articles/maestro-brain-verificacao-de-turno-en)
- [Advanced model settings per bot](/hc/ajuda/articles/maestro-brain-ajustes-avancados-do-modelo-en)
- [What Maestro AI and the Account Brain are](/hc/ajuda/articles/maestro-brain-overview-en)