Detected country: US
logo
Sign InBook a Demo
GuideRecipesDeveloper

Playbook Recipes

  • Data Ops recipes
    • Recipe: Data sync and ETL to a warehouse
    • Recipe: Scheduled reports and readouts
  • Engineering Ops recipes
    • Recipe: AI code review on pull requests with Cursor
    • Recipe: Incident response and on-call paging
    • Recipe: Triage new errors into tracked issues
  • Finance Ops recipes
    • Recipe: Invoice and expense processing
    • Recipe: Reconcile payments and payouts
  • Introduction
  • Marketing Ops recipes
    • Recipe: Campaign performance report
    • Recipe: Competitor monitoring digest
    • Recipe: Content and marketing operations
    • Recipe: Generate a content brief
  • RevOps recipes
    • Recipe: Automate new customer onboarding
    • Recipe: Enrich new leads automatically
    • Recipe: Route a deal review with an evaluation agent
    • Recipe: Score and route a lead with an evaluation agent
    • Recipe: Score, route, and follow up on leads
  • Support Ops recipes
    • Recipe: Auto-answer and deflect common tickets
    • Recipe: Catch a refund request with an evaluation agent
    • Recipe: Check the work before a reply
    • Recipe: CSAT follow-up after ticket resolution
    • Recipe: Escalate SLA breaches and priority tickets
    • Recipe: Triage a support email with an evaluation agent
    • Recipe: Triage and route support tickets
Loading…
logo

Powered by

Recipe: Invoice and expense processing

TL;DR: When an invoice or expense arrives (email or upload), this playbook extracts the key fields, validates them against rules and budgets, then parks with metaphor.waitForInput for human approval when needed. On Continue / Slack reply it creates the bill. Trigger is a webhook or inbox; outputs are a structured record and a durable approval gate.

Who this is for

Finance and ops teams processing invoices and expenses by hand.

What you'll need

  • Connectors: Email/inbox or upload source, accounting/AP system (HTTP), Slack (optional notifier).
  • Secrets: Accounting system API key, Slack token (if notifying).
  • Trigger: Webhook on new invoice/expense, or an inbox integration.

How to build it with Ask Ballet

  1. Open the Console on Home.
  2. Paste the prompt below; set your validation rules and approvers.
  3. Review the plan and confirm.
  4. Connect the inbox/AP system and Slack, then register the webhook.
Build a playbook that triggers when a new invoice arrives via webhook with a PDF link.
Extract vendor, invoice number, line items, amount, currency, and due date. Validate:
amount under the auto-approve threshold, vendor exists in our AP system, and no
duplicate invoice number. If valid and under threshold, create the bill in the AP system
and notify #finance. If over threshold or failing a check, call metaphor.waitForInput
with prompt, details (extracted fields + PDF link), and Approve/Reject choices — do not
busy-wait or poll Slack. After wake: on approve create the bill; on reject stop and notify.
Optionally post a Slack message from a notifier that wakes via POST /api/runs/:id/reply.

What the playbook does

  1. Webhook trigger — receives the invoice/expense.
  2. Code/HTTP step (extract) — parses fields from the document.
  3. Code step (validate) — checks thresholds, vendor, and duplicates.
  4. Code step (approve or auto-post) — under threshold: create the bill; over threshold: await metaphor.waitForInput({ prompt, details, schema }) so the run parks as Paused on the same runId.
  5. On wake — Studio Continue or a Slack notifier POST /reply returns the choice; approve creates the bill, reject aborts.
  6. HTTP step (notify) — confirms the outcome in Slack.

Variations and tips

  • Set a clear auto-approve threshold so only exceptions need a human.
  • Always check for duplicate invoice numbers before creating a bill.
  • Pass full extracted fields as details on waitForInput so reviewers see the payload in Studio.
  • Slack is a notifier for the same park — wake with requestId from state.resume, not a custom pause API. See pause and resume.
  • Send approved records into Reconciliation downstream.

Related articles

  • How do I pause and resume a playbook run?
  • How do I wake a suspended run with reply or resume?
  • Reconciliation
  • How do I store credentials with Secrets?
  • What triggers can start a playbook?