Skip to main content

What is a playbook?

A playbook is the authored, git-diffable artifact the Playbook engine runs. It has two layers:
  • Conversation layer - journeys of checkpoints (a goal, typed slots, guidance prose, and ordered advance rules) plus a persona.
  • Process layer - everything that isn’t conversation: tools, pipelines, handlers, interrupts, and policies.
There are two authoring formats and one engine. Start in the simple format; graduate to the full format when you need precision. Both compile to the same validated artifact and run identically.
Animated Playbook loading pipeline diagram showing simple YAML, full YAML, and legacy flow JSON converging into a validated Playbook artifact and one runtime.
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 what superdialog 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:
Which collect keys gate advancement depends on the step’s shape. A focused capture step (≤2 slots) requires all of them filled before the Director may advance; a branchy step collecting more than 2 per-path alternatives requires none - demanding every slot of a 14-slot category qualifier would deadlock the step. Use require: to override the heuristic (e.g. one mandatory key on an otherwise-branchy step).
Always add a goodbye interrupt. In testing, linear playbooks with no early exit never completed a single call (a satisfied caller loops until the turn cap); the same playbook with goodbye/busy interrupts completed every call.

Strict validation

Keys the format does not recognize - a typo’d done_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-step gate 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: expr rules (machine-evaluated transitions - zero LLM cost)
  • Typed/required slots, never_say, say_verbatim, silence policy, multiple journeys
The escape hatch is one-way: compile your simple file and continue authoring the result. There is no decompiler back.

The full format

Everything the engine can do, stated explicitly. The conversation layer is journeys 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