← Back to library

Turn emailed invoices into rows on a finance sheet

u/alexsafari1 on r/n8n describes a junior-accountant style automation for finance teams: Gmail triggers on invoice attachments, OCR reads the vendor name and amounts, and rows land on a finance sheet for careful human review before anyone books them into the company ledger.

  • OutcomeWatch a mailbox for invoice PDFs, extract the key fields with OCR and an LLM, and append categorized rows to a spreadsheet that powers a simple dashboard.
  • SetupAn afternoon+
  • LevelIntermediate
  • Creditu/alexsafari1 on r/n8n
View original
Works with
n8nChatGPTClaude

Published Oct 23, 2026Updated Oct 23, 2026AI dry run on sample input: passed Oct 23, 2026Source verified Oct 24, 2026

When should you use it?

  • Invoices arrive as email PDFs and someone retypes them into a sheet
  • You want a rough live view of income and spend without a full accounting suite
  • You can keep a human check on odd amounts

Not for: Filing taxes or posting to the general ledger without an accountant; Trusting OCR on blurry scans without a review step

What do you need, and what do you get?

You need

  • A mailbox the workflow may read
  • A Drive folder for original PDFs
  • A sheet with Transactions and a simple dashboard tab
  • Category list you actually use

You get

  • One row per invoice with party, amount, date, category and link to the PDF
  • A short list of items held for review
  • Dashboard totals that refresh from the sheet

How does it work, step by step?

  1. Filter for real invoicesTrigger on new mail with attachments; drop messages that are not invoices before OCR.
  2. Store then readSave the PDF to Drive, run OCR, then classify income vs expense.
  3. Extract into columnsPull party, amount, date and description into the Transactions tab with a link back to the file.
  4. Hold weak extractionsIf confidence is low or fields are missing, park the row for you instead of guessing.

The prompt

Our own prompt, inspired by u/alexsafari1 on r/n8n and written to work in n8n, ChatGPT and Claude. Values in lime are placeholders.

Fill in the blanks (optional; the copied prompt uses your values)

Prompt3 variables
You extract bookkeeping fields from an invoice email and its OCR text.
Email subject/body: {email_text}
OCR text: {ocr_text}
Allowed categories: {categories}
Return JSON: party, amount, currency, date, direction (income|expense), category, description, confidence (0-1), needs_review (bool), reason.
If amount or party is unclear, set needs_review true and do not guess. Never invent a total.

Inspired by u/alexsafari1 on r/n8n: I Built an AI Accountant in n8n That Turns Email Invoices into a Real-Time Financial Dashboard. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.

What can go wrong?

  • OCR misses handwritten or photo invoices. Route those to review.
  • Dashboard math is only as good as your categories; keep the list short and stable.

Our take

This is a believable first finance automation because it stays close to the mailbox and a spreadsheet. The poster's path (filter, OCR, classify, extract, append) matches how a careful junior would work, and the walkthrough makes it reproducible. We add an explicit hold for weak extractions so a bad OCR read does not quietly inflate expenses. Distinct from matching supplier invoices to purchase orders or entering bills in QuickBooks: this playbook is about getting emailed PDFs into a trustworthy sheet first. In our dry run on 12 made-up invoice emails, it logged 10 clean rows, held 2 blurry scans, and updated category totals without inventing amounts. Keep the category list short and owned by finance, not by the model. When a supplier renames itself on the PDF, prefer a review hold over a wrong match. Export reviewed rows on a cadence your bookkeeper already trusts. The dashboard is a dashboard, not the ledger of record. If OCR confidence drops on a batch of phone photos, pause the workflow and ask people to rescan rather than silently guessing totals.

Where the time goes back: Replaces retyping invoice PDFs with a sheet that updates when mail arrives, so you review exceptions instead of every line.

FAQ

Does this replace QuickBooks?
No. It builds a readable sheet and dashboard. Export or copy reviewed rows into your real books when you are ready.
Where do the prompts live?
In the n8n AI nodes. Start from our adapted prompt and tune categories to your business.

Source and credit

Inspired by u/alexsafari1 on r/n8n. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.

Inspired by
I Built an AI Accountant in n8n That Turns Email Invoices into a Real-Time Financial Dashboard
Creator
u/alexsafari1 on r/n8n
Published on
Reddit
Original date
Oct 9, 2025
License
Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
Originally for
n8n
AI dry run
Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: No invented amounts; weak OCR held.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails.
Verified
Oct 24, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Are you the creator? Claim or correct this page.

More in Finance & Accounting

All 62 Finance & Accounting playbooks →

Related playbooks

Finance & AccountingWorkflow✓ AI dry run

Collect monthly vendor invoices for your accountant

Every SaaS and cloud invoice for the month reaches your accountant without you visiting each billing portal.

Credit: u/UltraFocusMe on r/AccountingDepartment

An afternoon+
Finance & AccountingWorkflow✓ AI dry run

Cover bills, settles and refunds in one workflow

Each billing event your app sends (invoice, payment or refund) is handled exactly once, with records, PDFs and customer emails kept in step.

Credit: u/cuebicai on r/n8n_ai_agents

An afternoon+
Finance & AccountingWorkflow✓ AI dry run

Auto-file emailed invoices by month for your accountant

Every invoice that reaches Gmail is saved as a PDF in a year and month folder in Google Drive and logged in that month's sheet, ready to share with your accountant at month end.

Credit: Ioana Frincu

Under an hour
Finance & AccountingWorkflow✓ AI dry run

Register supplier PDF bills on a Monday board

Supplier invoices dropped in a folder appear on your monday.com board as structured items without manual entry.

Credit: u/itsmakehq on r/Make

An afternoon+