← Documentation

Playbooks

A playbook chains multiple AI assistants with branches and safety checks. Use X-VG-Flow instead of X-VG-Agent when you want a workflow — never send both headers.

💡 Quick start: Browse 88 active playbooks in the catalog below.

Headers

  • X-VG-Flow: your-playbook-slug — runs a published playbook
  • X-VG-Agent: your-agent-slug — single-agent mode (unchanged)
  • Both headers → 400 mutually_exclusive_headers

Streaming

Playbook execution does not support stream: true. The API returns HTTP 400 with error code orchestration_stream_unsupported. Use a buffered JSON client for X-VG-Flow calls; reserve streaming for single-agent X-VG-Agent requests.

Billing

Each live agent step counts as one request (input and output validations included, including reasks). Builder Simulate is free — no requests consumed. Publishing a playbook does not consume requests.

Simulate vs Live vs API

  • Simulate — dashboard preview; walks branches locally
  • Live run — full API test from the dashboard (each live agent step counts as one request)
  • Production API — same billing as Live run

Create and publish playbooks in the dashboard. See also the first playbook tutorial or the quickstart for single-agent setup.

Playbook Marketplace

Browse 88 production-ready playbooks. Fork any to your organization and start building.

Complete Catalog

All public playbooks — system & community

88 playbooks

Abandoned Cart Recovery

SystemE-commerce
3 steps | p50 2.23 ms | 3 validations

Classify how a shopper replied to a recovery prompt, draft a personalized win-back email that addresses their reason, and QA it for tone and links before it goes out.

3 agents · 3 steps

  1. Classify the reply
  2. Draft win-back email
  3. QA the email
3 steps | p50 2.00 ms | 3 validations

Let an agent propose tool or function calls, validate names against a configured whitelist, and route blocked calls to human review before execution.

3 agents · 3 steps

  1. Propose tool calls
  2. Tool whitelist guard
  3. Operator handoff
2 steps | p50 2.23 ms | 2 validations

Score a marketing campaign idea for fit and risk. Approved ideas are expanded into a structured creative brief; weak or risky ideas are returned with a reason instead.

2 agents · 2 steps

  1. Score the idea
  2. Write the brief

Complaint Triage

SystemSupport
3 steps | p50 2.39 ms | 3 validations

Triage incoming complaints by severity, escalate urgent cases, and draft a standard reply for routine issues.

3 agents · 3 steps

  1. Classify complaint
  2. Escalate urgent case
  3. Send standard reply

Cost Spike Re-ask Storm

SystemOperations
2 steps | p50 2.48 ms | 2 validations

Read today's re-ask and spend jump against the prior-week median, then ask a person before changing the budget cap. A spike is not the same event as an 80% or 100% budget email.

2 agents · 2 steps

  1. Summarize the spike
  2. Reviewer
2 steps | p50 2.48 ms | 2 validations

Classify a single review or NPS comment into structured JSON with sentiment and a primary topic from a fixed taxonomy. Invalid enum values are blocked deterministically — not silently mapped to the nearest tag. Run once per comment; batch ingestion loops on your side.

2 agents · 2 steps

  1. Tag sentiment and topic
  2. Add audit metadata
3 steps | p50 2.39 ms | 3 validations

Extract multi-week bottom-quartile evidence, draft a deprecation or traffic-shift plan, and require human approval before any sunset communication ships.

3 agents · 3 steps

  1. Extract failure evidence
  2. Draft sunset plan
  3. Owner approval handoff

Extract Then Decide

SystemOperations
3 steps | p50 2.48 ms | 3 validations

Pull structured data from a document, confirm with the user when safe, or send a short failure message when extraction fails checks.

3 agents · 3 steps

  1. Extract structured data
  2. Confirm to user
  3. Extraction failed
Page 1 of 5 · 88 total

curl

curl -s "https://api.valguard.ai/v1/chat/completions" \
  -H "Authorization: Bearer $VG_API_KEY" \
  -H "X-VG-Flow: support-automation" \
  -H "Content-Type: application/json" \
  -d '{"model":"groq/openai/gpt-oss-20b","messages":[{"role":"user","content":"Hello"}]}'

groq/openai/gpt-oss-20b is a sample. Any provider/model works, for example groq/llama-3.3-70b-versatile.

SDKs

Use withPlaybook() / with_playbook() / WithPlaybook() on the ValGuard client — see package READMEs under packages/sdk-*.

Error codes

  • mutually_exclusive_headers — both X-VG-Agent and X-VG-Flow sent
  • playbook_not_published — this slug exists in the project but the latest version is not published
  • flow_not_found — no playbook with that slug in the API key's project
  • monthly_cap_exceeded — monthly request quota used up (429); each live agent step counts as one request