Documentation Index
Fetch the complete documentation index at: https://docs.gainable.dev/llms.txt
Use this file to discover all available pages before exploring further.
What is a playbook?
A playbook is the recipe an agent runs when an objective needs attention. It has three parts:- A trigger. What starts the playbook. One of schedule, data change, webhook, or user-triggered.
- Steps. A sequence of tool calls, each one observed by the runtime and recorded in the action log.
- Guardrails. Constraints that bound the playbook: rate limits, scopes, risk tier, allowed recipients, max recursion.
The shape of a playbook
The playbook editor
Playbooks live in the Autopilot UI. The editor shows:- Trigger panel. Pick the trigger type and configure it.
- Step list. Drag steps. Each step is a tool call. Inputs can reference previous step outputs.
- Guardrails panel. Risk tier, rate limits, scopes, recipient exclusions.
- Test panel. Run the playbook against test data without lighting up real recipients.
”Simulate on last 30 days”
Before turning a playbook live, run Simulate on last 30 days. The runtime replays your real data through the playbook against the last 30 days of activity and shows:- How many times the trigger would have fired
- How many drafts would have been produced
- Per draft: the recipient, the message, the reasoning chain, the tool calls
- An estimate of approval workload (drafts per day, per user)
Simulate is the safety net. It’s the difference between “the playbook looks reasonable” and “the playbook would have produced 240 emails to one customer last Tuesday.” Always simulate before going live.
send_email, send_slack, send_sms, or call_external for real. It produces drafts you can read but never delivers them.
Step references
Steps can reference each other’s outputs. The reference syntax is{{ stepN.field }} or {{ stepN.collection[*].field }} for arrays.
Guardrails
Guardrails bound what a playbook can do regardless of its steps. They are the policy layer that exists outside the agent’s reasoning.| Guardrail | What it does |
|---|---|
| Risk tier | One of draft_and_approve, auto_with_undo, auto. See risk tiers. |
| Rate limit per user | Max drafts a single user can be the owner of in a window |
| Rate limit per recipient | Max drafts that can target a single recipient in a window |
| Allowed recipients | Whitelist of domains or addresses |
| Excluded recipients | Reference to a do_not_contact collection |
| Scope | app_wide or personal (scopes) |
| Max steps | Hard cap on tool calls per playbook run |
| Max recursion | Prevents a playbook from triggering itself unbounded |
Common playbook shapes
Watch and notify
Watch and draft
Schedule and digest
Inbound and route
Editing playbooks
Edit through chat or the editor:Best practices
Always simulate before going live
Always simulate before going live
A 30-day simulation catches load problems, recipient explosions, and bad filters before they reach real users.
Keep playbooks single-purpose
Keep playbooks single-purpose
“Nudge stalled deals” is a clear playbook. “Manage the sales pipeline” is a bundle of five playbooks pretending to be one.
Prefer draft_for_approval over auto-send
Prefer draft_for_approval over auto-send
The default for outbound work is
draft_for_approval for a reason. Graduate to auto_with_undo only after a clean approval history.Use exclusions, not blanket disables
Use exclusions, not blanket disables
A
do_not_contact collection lets you opt specific records out without breaking the whole playbook for everyone else.Learn more
Triggers
Schedule, data change, webhook, user-triggered
Tools
The fixed registry of tool calls
Risk tiers
Draft-and-approve, auto-with-undo, auto
Recipes
Worked examples of common playbooks