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

# Runbooks

> Write step-by-step procedures, call your own APIs from them, and run them from a ticket or conversation.

A runbook is a written procedure for one situation, such as "reissue a corrected invoice" or "verify a payout account change". Each step tells the person running it what to do, asks for the information it needs, checks it, and can run actions. Values collected in one step become `{{variables}}` that later steps use.

Runbooks are predictable: the same inputs always take the same path and run the same actions.

Admins write runbooks and API actions. Members run them. Viewers can see runs but not run steps.

## Plans

| Plan | Runbooks | API actions |
| - | - | - |
| Core | Not included | Not included |
| Growth | 10 | 5 |
| Scale | 50 | 25 |
| Enterprise | Unlimited | Unlimited |

Archived runbooks don't count toward the limit. Run history is kept as long as your plan keeps automation runs. See [Billing and plans](https://docs.joinsayless.com/admin/billing-and-plans.md).

## Create a runbook

Open [Settings → Runbooks](https://joinsayless.com/\{workspace}/settings/runbooks) and choose **New runbook**. Give it a name and a short description of when to use it.

### Variables

Variables hold the values a run collects, such as `invoice_id` or `refund_amount`. Each has a type: text, long text, number, date, yes or no, or a choice from a list.

Steps can also read fields of the record the run is on, such as `record.subject`, `record.status`, `company.name`, `contact.email`, and `me.name`. Type `{{` in a step's instructions to insert a variable or field.

### Steps

Steps run in order. Each step has:

* **Instructions** for the person running it.
* **Inputs** to fill. **Who gives it** is either the person running the step or the customer's reply. Add rules, such as a pattern, a minimum or maximum, or allowed values, with the message to show when a value fails.
* **Only run when**, a condition on variables or record fields. When it doesn't match, the run skips the step.
* **Actions** the step runs: set status, priority, assignee, team, or labels; add an internal note; reply to the customer; or call one of your [API actions](#api-actions).
* **End the run when**, a condition checked after the step. When it matches, the run ends with the outcome you choose (resolved, escalated, or cancelled) and an optional note.

A step that changes something asks the person to confirm with **Run step**.

### Wait for the customer's reply

Set an input's **Who gives it** to the customer's reply, then give a **Reply pattern**, such as `acct_[A-Za-z0-9]{6,}`. The run waits on that step, and the first match in the customer's next reply fills the value. Messages sent before the wait started don't count.

Choose what happens **On timeout**: end the run or skip the step. While it waits, the person running it can still type the value themselves.

### Publish

Changes stay in a draft until you choose **Publish**. Each publish creates a new version. Runs already in progress keep the version they started with, so editing a runbook never changes a run halfway through.

From **History**, compare versions or **Revert** to an earlier one; reverting publishes it again as the newest version. **Archive** a runbook to stop new runs without deleting its history.

## API actions

An API action is a call to your own API that runbook steps can make: look up an order, issue a refund, or update an account.

Open [Settings → Actions](https://joinsayless.com/\{workspace}/settings/runbook-actions) to create one, or choose **Import from API spec** to start from an OpenAPI spec in JSON. An action has:

* A **Method** and **URL**. The URL must use `https` and a public address. Inputs can fill the path or query, but never the host.
* **Headers** and a **JSON body**, with `{{inputs}}` filled from the step.
* **Secrets**, such as an API key, referenced as `{{secret.API_KEY}}`. Values are encrypted, never shown again after you save them, and never appear in run results.
* **Outputs**: a **Response path**, such as `data.refund.id`, that saves part of the response into a variable for later steps.

Every call sends an `Idempotency-Key` header that is the same for one step of one run, so a retried call can't repeat the change on your side. Calls don't follow redirects, time out after the action's limit, and try up to three times when the network fails or your API returns a `5xx` error.

Publishing a runbook saves a copy of the API actions it uses. After you edit an action, publish the runbook again to use the new version.

## Run a runbook

On a ticket or conversation, open the **Runbooks** panel and choose a runbook, or use **Run runbook…** from the command menu. Only one run of each runbook can be open on a record.

Fill the step's inputs and choose **Run step**. Steps with API calls, notes, or replies show their progress while they run. Use **Previous** to go back to an earlier step; actions that already succeeded in the run are not repeated.

### When a step fails

The step shows what failed and where to fix it, such as a value from an earlier step or a field on the record. Choose **Retry step** to try again; actions that already succeeded are skipped.

If Sayless can't tell whether a reply to the customer was delivered, it never sends that reply again. Check the conversation. If the reply arrived, choose **Mark as sent and continue**. If it didn't, cancel the run and reply yourself.

### Cancel a run

Choose **Cancel run** to stop. Deleting the ticket or conversation cancels its open runs.


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