Video summary

Workflow Automation with Claude Code & Zapier MCP | AI Automation Project

Main summary

Key takeaways

Business

Goal / Use case (Invoice AP automation, production-oriented)

Build an AI invoice processing agent for companies that receive vendor invoices via email (PDFs) and must match invoices to internal records before entering them into QuickBooks and notifying teams via Slack.

Target scenario: a company like Athletic Technologies processing services from many vendors (e.g., office supplies, cleaning services) with a dedicated Accounts Payable workflow.


Current manual workflow (problem statement)

Vendor onboarding

  • Vendors are added to a Vendor Master (company name, address, bank account details, etc.).

Purchasing workflow

  • For each vendor/service contract, Athletic issues a Purchase Order (PO) with an agreed amount (example: $4,250) and a PO number.

Invoice validation

  • Vendors invoice after services are rendered; the invoice includes:
    • the PO number
    • an amount that may vary within an allowed tolerance
  • AP checks incoming invoices against:
    • Vendor Master (vendor identity + bank account)
    • PO Master (PO number + approved amount)
    • Tolerance rule: invoice amount must be within ±5% of the PO-allowed amount
    • Bank account match to detect fraud

Outcomes

  • If valid → approve and post to QuickBooks for payment.
  • If suspicious → flag and send Slack/email alerts for human review.

Core automation approach (two implementation options compared)

Approach 1: Claude Code native connectors

  • Used to connect to systems like Gmail / QuickBooks / Slack.
  • Blockers encountered:
    • Gmail connector returned metadata only and did not provide the PDF content needed for extraction.
    • QuickBooks connector lacked a required action (“post bill/invoice to QuickBooks”).

Approach 2: Zapier MCP server (recommended)

  • Use Zapier’s single MCP server (claims 8,000+ integrations) as the connector layer between Claude Code and:
    • Gmail (fetch invoices + PDFs)
    • QuickBooks Online (create/post bills)
    • Slack (alerts/notifications)

Why it’s operationally easier

  • Avoids building custom MCP servers for each tool.
  • Avoids manual auth complexity such as refresh token maintenance (e.g., QuickBooks tokens expiring ~every 60 minutes).

Business logic / validation rules (embedded in agent “skills”)

Explicit validation rules

  • PO number must match the PO Master.
  • Vendor must match Vendor Master.
  • Amount rule: approved invoice amount must be within 5% of the PO amount.
  • Bank account match required (flag mismatches as potential fraud).

Suspicious pattern detection examples

  • Amount mismatch beyond tolerance
    • Example: PO approved $18,500 vs invoice requested $22,000 → exceeds 5%.
  • Urgency language / scam cues in email text
    • Example: “please make the payment ASAP”, plus spelling mistakes.
  • Bank account mismatch → flagged and alerted.

Execution flow / playbook (end-to-end system behavior)

Ingest

  • Claude Code uses Zapier MCP → Gmail to find invoice-related emails.
  • Filters applied:
    • invoices must include PDF attachments.

Extract

  • Claude Code pulls invoice PDFs via Zapier web-fetch and extracts fields such as:
    • invoice number
    • PO number
    • total amount
    • related details

Validate

  • Uses internal data as source of truth from a SQLite DB containing:
    • Vendor Master
    • Purchase Order Master
    • Invoices table (extracted invoice records + statuses)
    • Audit log table for traceability
  • Applies status transition rules, including 5% PO tolerance and bank account matching.

Decide

  • If approved:
    • Update invoice status in SQLite
    • Trigger the next human/payment workflow
  • If suspicious:
    • Send Slack alerts (and optionally email drafts)

Action in accounting

  • When instructed (“Post to QuickBooks”):
    • Zapier MCP calls QuickBooks Online to create bill.

Notify & report

  • Slack alerts for flagged invoices.
  • Optional month-end report via Slack/email.
  • All decisions recorded to audit log for compliance.

Frameworks / mechanisms highlighted (process components)

Skill-based agent instructions (“skill.md”)

  • A domain-specific instruction set to reduce hallucinations and enforce organizational business rules.
  • Includes directives such as:
    • “Use MCP SQLite as source of truth”
    • “Persist every decision to audit logs
    • “Enforce status transition rules
    • “PDF extraction on ingest”
    • “Validation rules (including 5% PO rule)”
    • “Slack alert flow” and “Email alert flow”

MCP tool architecture

  • Zapier MCP server = integration hub for external SaaS
  • SQLite MCP server = internal system-of-record for vendors/POs/invoices/audit logs

Status workflow / state machine (implicit)

  • Agent stores invoice readiness/approval states and allows actions based on those states:
    • Ready → Approved → Posted to QuickBooks
    • flagged items trigger alerts.

Concrete operational example (what the agent did)

  • The agent found 4 invoice emails.
  • It extracted invoice data and populated the SQLite invoices table.
  • It flagged invoices:
    • Invoice #1 (amount mismatch + urgency language scam cues)
    • Invoice #3 (amount mismatch beyond 5% tolerance)
    • Invoice #4 (bank account mismatch)

Actions executed

  • Sent a Slack alert for invoice #4 due to bank account mismatch.
  • Approved invoice #2 (status transition in SQLite).
  • Posted approved invoice #2 to QuickBooks, creating an unpaid bill for the accounting user to pay.

Key “metrics / KPIs” mentioned

  • No quantified business KPIs like CAC/LTV/churn/revenue targets were stated.
  • Operational metrics were implied, but not enumerated as numeric KPIs:
    • Count of invoices processed in a month-end report (e.g., “total invoice processed” in Slack message).
  • Specific business rule threshold used:
    • 5% PO amount tolerance

Actionable recommendations (how to implement operationally)

  • Use a Zapier MCP server to avoid:
    • missing connector capabilities (PDF content access, QuickBooks bill posting)
    • heavy custom integration maintenance (auth + token refresh, custom MCP coding per tool)
  • Centralize internal truth in a SQLite database (via SQLite MCP server):
    • Vendor Master
    • PO Master
    • Invoices (statuses)
    • Audit log
  • Put all organization-specific rules in skill.md:
    • PO tolerance (5%)
    • required matching fields
    • alerting workflows (Slack + email drafts)
    • strict state transitions and audit logging
  • Include auditability from day one:
    • “Persist every decision to audit logs” and expose histories from Zapier/agent runs.

Presenters / sources

  • Presenter(s): Not specified (no name given in the subtitles).

Original video