{
  "$schema": "https://promptfoo.tech/schemas/workflow-template.json",
  "name": "n8n: Extract Every Invoice in Your Inbox with GPT-4o Vision",
  "slug": "n8n-invoice-parsing-with-vision",
  "platform": "n8n",
  "category": "business",
  "difficulty": "Intermediate",
  "tags": [
    "n8n",
    "vision",
    "invoices",
    "openai",
    "accounting"
  ],
  "summary": "Attach an inbox to n8n, parse every PDF and image invoice with vision, and land structured line items in Google Sheets — no OCR service required.",
  "overview": "Bookkeepers still copy line items from PDFs by hand. Vision-capable LLMs eliminate that job — including for handwritten receipts. This workflow turns any inbox into a structured invoice ledger in Google Sheets, with confidence scores so humans review only the uncertain ones.",
  "variables": {
    "WEBHOOK_URL": "<your webhook URL>",
    "API_KEY": "<your provider API key>",
    "OPENAI_API_KEY": "sk-..."
  },
  "steps": [
    {
      "order": 1,
      "name": "Set up a dedicated inbox",
      "description": "accounting@yourdomain — vendors and forwarding rules go here. Never point this at a personal inbox."
    },
    {
      "order": 2,
      "name": "Filter attachments precisely",
      "description": "Reject anything > 10MB and anything not PDF/PNG/JPG. Multi-page PDFs need conversion to images before vision calls."
    },
    {
      "order": 3,
      "name": "Design the JSON schema first",
      "description": "Match your accounting software's field names exactly. Retro-fitting later means every historical row needs migration."
    },
    {
      "order": 4,
      "name": "Ask for confidence per field",
      "description": "Not just per invoice. If the total is high-confidence but the tax line is low, that's exactly the review signal you want."
    },
    {
      "order": 5,
      "name": "Route by confidence",
      "description": "≥0.85 → main sheet. <0.85 → review sheet. Weekly, sample review-sheet rows to tune the threshold."
    },
    {
      "order": 6,
      "name": "Archive originals",
      "description": "Upload every file to Drive under /invoices/YYYY/MM/. Store the link in the row for auditability."
    }
  ],
  "howItWorks": [
    "IMAP trigger monitors an accounting@ inbox for messages with attachments.",
    "Attachments are filtered to PDF / PNG / JPG and passed to GPT-4o with a strict JSON schema.",
    "The model returns vendor, invoice number, date, currency, subtotal, tax, total, and line items.",
    "Confidence < 0.85 → routed to a 'Review' sheet; otherwise → appended to the main ledger.",
    "Original file is uploaded to Google Drive with a link stored in the row."
  ],
  "benefits": [
    "Kills a 4-hour weekly bookkeeping task.",
    "Structured line items — not just totals — mean better category analytics.",
    "Confidence-based routing keeps humans in the loop only where it matters."
  ],
  "useCases": [
    "SMBs with 20-200 invoices/month.",
    "Consultancies handling client expense receipts.",
    "Anyone whose bookkeeper still asks 'can you send me the PDF?'"
  ],
  "example": "Row: 2026-05-14 | Acme Cloud | INV-8821 | USD 1,248.00 (subtotal 1,155.00, tax 93.00) | 4 line items | conf 0.94 | drive.google.com/…",
  "faqs": [
    {
      "q": "Multi-page invoices?",
      "a": "Convert PDF → per-page images and pass them all in a single vision call. Combine line items in a post-processing step."
    },
    {
      "q": "Handwritten receipts?",
      "a": "GPT-4o handles them surprisingly well, but drop your confidence threshold to 0.7 and expect more review."
    },
    {
      "q": "Cost per invoice?",
      "a": "Roughly $0.005-0.02 per page at current GPT-4o pricing. Cheaper than any dedicated OCR SaaS at this volume."
    }
  ],
  "source": "https://promptfoo.tech/workflows/n8n-invoice-parsing-with-vision",
  "updated": "2026-05-25",
  "license": "CC-BY-4.0"
}