> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ada.cx/llms.txt.

# playbooks

Read and change the [Playbooks](/docs/automation/playbooks) of your AI Agent. A v1 Playbook holds Markdown. A v2 Playbook holds structured steps in JSON.

## Commands

| Command                                | What it does                                                                                     |
| -------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `playbooks list`                       | Lists Playbooks, one page at a time. `--tags` filters by tag ID.                                 |
| `playbooks get <id>`                   | Shows one Playbook. `--content` adds the Markdown or the step tree.                              |
| `playbooks create`                     | Creates a Playbook from Markdown, from JSON steps, or from a file.                               |
| `playbooks update <id>`                | Changes the content, settings, tags, or availability rules of a Playbook, or turns it on or off. |
| `playbooks update-step <id> <step-id>` | Sets or clears the conversation deviation behavior of one Ask step in a v2 Playbook.             |
| `playbooks deviations <id>`            | Shows the conversation deviation behavior of a v2 Playbook and of each Ask step.                 |
| `playbooks delete <id>`                | Deletes a Playbook.                                                                              |
| `playbooks steps-schema`               | Prints the v2 step format, with each step type and examples.                                     |
| `playbooks export-steps <id>`          | Exports the steps of a v2 Playbook as JSON, ready for `create` or `update`.                      |
| `playbooks upload-image <file>`        | Uploads an image for a v2 Send step and prints its attachment and placeholder.                   |
| `playbooks generate`                   | Drafts a Playbook from instructions or from a PDF. It does not save the draft.                   |

## Examples

Create a v2 Playbook from a JSON steps file. The new Playbook is off:

```bash
adacli acme playbooks create --name "Order status" --version 2 --file order-status.json \
  --description "The end user asks where their order is"
```

Edit the steps of a v2 Playbook. Export the steps, change the file, then send it back:

```bash
adacli acme playbooks export-steps <playbook-id> --sections -o steps.json
adacli acme playbooks update <playbook-id> --file steps.json
```

Turn on a Playbook:

```bash
adacli acme playbooks update <playbook-id> --active
```

Keep the AI Agent in the Playbook when the end user asks for a human at one Ask step, then check the result:

```bash
adacli acme playbooks update-step <playbook-id> <step-id> --on-human-request stay_in_playbook
adacli acme playbooks deviations <playbook-id>
```

Draft a Playbook from a policy document:

```bash
adacli acme playbooks generate --pdf refund-policy.pdf --instructions "Focus on self-service refunds"
```

## Details

* `create` makes an inactive Playbook unless you pass `--active`. An inactive Playbook does not run in conversations.
* The name has a maximum of 128 characters. The description has a maximum of 512 characters. `--referenced-articles` takes a maximum of 5 article IDs.
* `--file` reads a `.md` file as v1 Markdown and a `.json` file as v2 steps. An update with JSON steps makes the Playbook v2.
* Start each steps update from `export-steps <id> --sections`. The export keeps the reasoning level and the images of each step.
* `upload-image` accepts a PNG, JPEG, or GIF file of 5 MB or less. Save a Playbook that uses the image within 24 hours, or the upload expires.
* `update-step` takes `inherit` to clear an override. The step then follows the Playbook default.
* `delete` fails while another Playbook references the Playbook. Before you turn off or delete a Playbook, run `start-triggers list --playbook <id>`.
* In `--rules`, `v()` takes a variable ID from `adacli acme variables list`, not a variable name.

For every option of a command, run it with `--help`, for example `adacli acme playbooks create --help`.

## Related commands

* [`start-triggers`](/adacli/commands/start-triggers): run a Playbook when a conversation starts on a channel.
* [`api-tools`](/adacli/commands/api-tools): manage the API tools that a Playbook runs.
* [`changesets`](/adacli/commands/changesets): stage and test Playbook changes before they go live.

---

Have any questions? Contact your Ada team, or email us at [](mailto:help@ada.cx?subject=Help%20Docs%20inquiry).