> ## Documentation Index
> Fetch the complete documentation index at: https://chatbase.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How Procedures Run

> How the AI agent decides which Procedure to run, why a Procedure may be skipped, and how Procedure-only Actions keep certain tools on rails.

When a message comes in, the AI agent looks at your **active** Procedures, decides
whether one applies, and if so, follows its steps. This page explains the rules
that govern that decision so your Procedures behave predictably.

## Only one Procedure runs per turn

Within a single turn, the AI agent runs **at most one Procedure**: the one whose
**trigger** best matches what the customer is asking for *right now*. It never
executes two Procedures in the same reply.

This is a per-turn limit, not a lock. The active Procedure can change from one
message to the next: if the customer is partway through Procedure A and then sends
a message that matches Procedure B's trigger, the AI agent can switch to Procedure B
on that turn.

> [!NOTE]
>
> A Procedure stays in flight across turns while the customer is mid-flow (for
> example, replying "yes" or providing a value the AI agent asked for). It ends when
> the situation is handled, or when the customer clearly switches topics, at which
> point a different Procedure can engage on the next turn.

## Procedures are dropped when an Action isn't available

A Procedure can reference Actions (with `@action_name`) in its steps. Before a
Procedure is even considered for a conversation, the AI agent checks that **every**
Action it references is available on the **current channel**.

If even one referenced Action is unavailable, the **whole Procedure is skipped** for
that conversation. An Action counts as unavailable when it is:

* Disabled or removed,
* Disabled on the current channel, or
* Not supported on the current channel/medium (for example, a Widget-based Action
  on a channel that can't render Widgets).

> [!WARNING]
>
> The check is all-or-nothing and covers steps **inside conditional branches too**,
> even branches that might never run on a given conversation. If a deep branch
> references an Action that's off on, say, WhatsApp, the entire Procedure is dropped
> on WhatsApp. This is intentional: a half-runnable Procedure is worse than none.

**What this means for you:** if a Procedure works in one channel but seems to be
ignored in another, check that *all* of its referenced Actions are enabled on that
channel.

## Procedure-only Actions

By default, the AI agent can call any enabled Action on its own whenever the Action's
**When to use** matches. Sometimes you want the opposite: an Action the AI agent
should **never** reach for by itself, and only ever run as a deliberate step inside
a Procedure, for example a "process refund" Action you only want fired after the
refund Procedure's checks have passed.

Turn on **Only use in Procedures** in the Action's settings to enforce that. The
Action stays enabled and fully functional, but:

* The AI agent won't select it on its own judgment, so its **When to use** field is
  hidden (it no longer needs one).
* It runs **only** when a Procedure step references it with `@action_name`.

This keeps sensitive tools on rails — they can't fire outside the flow you
designed. See [Actions](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#only-use-in-procedures)
for where to find the setting.

## Waiting on the customer

If a step calls an Action that needs user input (an account picker, a form, a
confirmation), the AI agent treats it as a **pause**, not a failure. It tells the
customer it's waiting, then stops. It resumes the same step once the customer
responds. It won't retry or jump to another Action.

## Troubleshooting

> [accordion] My Procedure never triggers
>
> Confirm it's **Active**, and that its trigger describes the customer's intent
> clearly and distinctly from other Procedures. Overlapping triggers can cause a
> different Procedure to win.

> [accordion] It works on the website but not on WhatsApp/another channel
>
> A referenced Action is likely unavailable on that channel, which drops the whole
> Procedure there. Enable every referenced Action on that channel.

> [accordion] Two things should happen at once
>
> Only one Procedure runs per turn. Combine the flow into a single Procedure (using
> branches) rather than expecting two Procedures to run together.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.