What is a playbook?
A playbook is the authored, git-diffable artifact the Playbook engine runs. It has two layers:- Conversation layer -
journeysof checkpoints (a goal, typed slots, guidance prose, and ordered advance rules) plus apersona. - Process layer - everything that isn’t conversation:
tools,pipelines,handlers,interrupts, andpolicies.
Playbook.load(path) auto-detects all three, so callers never branch on format.
The simple format
Prose steps, a structured persona, and reference data as real YAML. This is whatsuperdialog generate writes.
Section reference
Also valid at the top level:
name, channel, tone, call_type, timezone,
memory_enabled, followup_enabled, and the multi-entity toggles multi_entity /
supervisor. Any key not in this set raises at load (see Strict validation).
Per step:
Routing example - a branch off the default chain, and two terminal outcomes:
Strict validation
Keys the format does not recognize - a typo’ddone_wehn, an invented top-level
language_lock: - raise at load with the dotted path of every offender,
instead of being silently dropped (config theater: you think it’s set, the
runtime never sees it). For live loaders that must not kill a call over a stale
authored file, downgrade to a warning:
What the simple format cannot express
Multiple terminals/outcomes, per-stepgate and then/branches routing are
now all expressible in the simple format (above). When you need any of these,
move to the full format:
- Pipelines and tools (transactional steps - holds, payments)
judge: exprrules (machine-evaluated transitions - zero LLM cost)- Typed/required slots,
never_say,say_verbatim, silence policy, multiple journeys
The full format
Everything the engine can do, stated explicitly. The conversation layer isjourneys of checkpoints; the process layer is tools, pipelines,
handlers, interrupts, policies.
The building blocks
Validation runs on load and raises on unknown checkpoint/pipeline/tool refs,
duplicate ids, undeclared
requires keys, and the reserved pipeline result
key - typos fail fast, not mid-call.
judge: expr rules are evaluated LLM-free at every quiescence hop - this is
what makes compiled router chains instant. The expr language is a sandboxed,
AST-whitelisted subset of Python over slots, results, env, and pipeline.
See the API Reference.Generate, then refine
How it runs
This page is about what you write. For what happens - the Talker/Director compound runtime, gating semantics, and the event log - see Architecture. The mental model is in Thinking in Playbooks.Architecture
The runtime that executes a playbook
Tools
The process layer in depth
API Reference
Every field and the expr language
Flows (legacy)
Graph authoring and migration