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

# Books — Playbooks & Runbooks

> Automate your operations with Books: reusable Runbooks and orchestrated Playbooks you can build in plain language, schedule, and run — with the AI doing the work.

import { CardGroup, Card, Note, Tip, Warning, Steps, Step } from '@mintlify/components';

**Books** is where you turn the things you do by hand into repeatable automation. You describe what you want in plain language, Myrmex assembles it into a reviewable workflow, and — once you approve it — the agents run it on a schedule, on demand, or from a webhook. Two building blocks make it up: **Runbooks** and **Playbooks**.

<Note>
  Open Books from the **Automation** quick action in the [Directory](/documentation/ai-workspace/overview). It opens in the Workspace with two tabs — **Playbooks** and **Runbooks** — plus a single **Automation** button to create something new.
</Note>

## Runbooks vs. Playbooks

<CardGroup cols={2}>
  <Card title="Runbook — the reusable step" icon="file-lines">
    A single, self-contained procedure: a natural-language instruction for the AI,
    one tool action, or a sandboxed script. The atomic unit you compose from.
  </Card>

  <Card title="Playbook — the orchestration" icon="diagram-project">
    A workflow that chains runbooks in order, passing each step's output to the
    next, and attaches a **trigger** (schedule, webhook, or on demand). This is the
    automation that actually runs.
  </Card>
</CardGroup>

### Kinds of runbook

A runbook is one of a few kinds, so a step can be as simple as a prompt or as precise as a single API call:

| Kind                | What it does                                                                                                                                            |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Centurion (LLM)** | A natural-language instruction the AI carries out — the most flexible kind. Write it like you'd ask in chat, `@`-mentioning devices and integrations.   |
| **Tool**            | One catalog action against an integration — a specific verb (enrich an offense, list alerts, open a ticket) run in a chosen mode with typed parameters. |
| **Script**          | A sandboxed Go procedure (`Run(ctx)`) for deterministic logic, limited to an allowlist of integrations you specify.                                     |

## Building a Playbook

A playbook is a visual workflow. Its steps are runbooks laid out top to bottom; the trigger sits at the start.

<Steps>
  <Step title="Add steps">
    Add runbooks as steps — a Centurion instruction, a tool action, or a script.
    They run in order, and each step can reference a previous step's output with
    `{{steps.N.output...}}` bindings.
  </Step>

  <Step title="Add conditions (optional)">
    A step can **loop** over a list (`for each`), run only **if** a condition holds,
    or **stop** the playbook when one does — so the workflow adapts to what it finds.
  </Step>

  <Step title="Choose a trigger">
    Decide how the playbook starts (see below).
  </Step>

  <Step title="Set the service user">
    A playbook runs as a **service user** you pick — the identity whose access and
    approvals its actions use. A playbook can't run until one is set.
  </Step>

  <Step title="Save and run">
    Save the playbook, then run it — manually, or let its trigger fire it.
  </Step>
</Steps>

<Warning>
  Steps that **change** a system (close a ticket, isolate a host, block an address)
  are marked **WRITES** in the editor. Automation still respects Myrmex's guardrails
  — review what a playbook does before you enable it.
</Warning>

### Triggers

<CardGroup cols={2}>
  <Card title="On demand" icon="play">
    Runs only when you start it. Doesn't consume any schedule slots.
  </Card>

  <Card title="Recurring schedule" icon="calendar-days">
    Runs on an interval — from **every minute** through hourly, daily, weekly, or
    monthly — with a start time and an optional end date.
  </Card>

  <Card title="One-time schedule" icon="calendar-day">
    Runs once, at a date and time you pick.
  </Card>

  <Card title="Webhook" icon="link">
    Runs when an external system calls the playbook's webhook URL — useful for
    wiring Myrmex into your own tooling.
  </Card>
</CardGroup>

<Note>
  Scheduled and recurring playbooks reserve **calendar slots**; on-demand runs
  don't. Keep a playbook **persistent** to retain it after it runs — otherwise a
  one-off is cleaned up automatically.
</Note>

## Create in Plain Language

You don't have to build a workflow by hand. The **Automation** composer turns a description into a ready-to-review playbook:

<Steps>
  <Step title="Describe the automation">
    Write what you want — for example, *"For every open offense on `@qradar`,
    enrich it and open an incident on `@my-itsm`."* `@`-mention at least one
    **device or integration**; mention **tools** too, or let Myrmex pick the right
    ones.
  </Step>

  <Step title="Myrmex builds it">
    The AI generates a draft playbook and its runbooks, with a plan summary and the
    assumptions it made. This runs asynchronously and can take a few minutes — you
    can keep working.
  </Step>

  <Step title="Review the draft">
    The result renders as a workflow preview you can read step by step — no need to
    open the editor. If Myrmex needs more detail, it asks clarifying questions first.
  </Step>

  <Step title="Approve & enable">
    **Discard** it, **Edit steps** in the full editor, or **Approve & enable** to
    activate it. A generated automation stays a **draft** until you approve it.
  </Step>
</Steps>

<Tip>
  Generated playbooks are drafts on purpose — nothing an AI writes runs until you've
  read it and hit **Approve & enable**.
</Tip>

## Running and Tracking

Run a playbook from its trigger, the **Run** action in the directory, or on its
schedule. Each run streams its progress — the current step, the agent's output and
tool calls, and token usage — and every run is kept in the playbook's **execution
history** so you can see what happened and when.

## Who Can Use Books

Books is governed by its own permissions, so you can separate authoring from running:

| Permission                                         | Grants                                   |
| -------------------------------------------------- | ---------------------------------------- |
| `books.playbooks.read` / `books.runbooks.read`     | View playbooks and runbooks.             |
| `books.playbooks.create` / `books.runbooks.create` | Create new playbooks and runbooks.       |
| `books.playbooks.run` / `books.runbooks.run`       | Execute existing playbooks and runbooks. |

<Note>
  Automation is part of Myrmex's advanced capabilities — scheduling, unlimited
  execution, per-minute intervals, and extra playbook slots vary by plan. See
  [Plans & Licensing](/documentation/get-started/license) for what's included.
</Note>

## Related

<CardGroup cols={2}>
  <Card title="Change Management" icon="clipboard-check" href="/documentation/change-management/overview">
    For governed, approval-gated changes and patch rollouts.
  </Card>

  <Card title="The AI Workspace" icon="comments" href="/documentation/ai-workspace/overview">
    Where you talk to the agents and `@`-mention the devices and tools your
    automations use.
  </Card>
</CardGroup>
