← Back to library

Auto-file emailed invoices by month for your accountant

Every 15 minutes, Ioana Frincu's n8n workflow looks in Gmail for new invoice messages, keeps the attached PDF or renders a linked invoice page to PDF, files it in a Drive folder for its month, has Claude pull out five accounting fields into a monthly sheet, and labels the email so it is handled only once.

  • OutcomeEvery 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.
  • SetupUnder an hour
  • LevelIntermediate
  • CreditIoana Frincu
View original
Works with
n8nClaude

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

When should you use it?

  • Your accountant asks for last month's invoices and you hunt through email to find them
  • Suppliers send a mix of PDF attachments and view-your-invoice links
  • You already use Gmail, Google Drive and Google Sheets

Not for: Invoices that sit behind a supplier login; those still need a manual download; Businesses whose accounting software already captures bills straight from email

What do you need, and what do you get?

You need

  • An n8n instance (cloud or self-hosted)
  • Gmail, Google Drive and Google Sheets connections
  • An Anthropic API key or n8n AI credits for the extraction step
  • A PDF.co key if you want linked invoice pages turned into PDFs
  • A root invoices folder in Drive

You get

  • One PDF per invoice inside a YYYY/YYYY-MM folder
  • A monthly sheet in the same folder with supplier, tax ID, issue date, total and currency
  • A Gmail label on each handled email so nothing is filed twice
  • Empty cells, not guesses, where a value is missing

How does it work, step by step?

  1. Import the templateOpen the creator's n8n template, import it and connect Gmail, Drive and Sheets.
  2. Point it at your foldersSet your root invoices folder ID in the settings step and create the processed label in Gmail.
  3. Tune the searchAdjust the Gmail search in the trigger so it catches your suppliers' invoice and receipt emails without pulling in newsletters.
  4. Connect the extractorAdd your Anthropic credential so the Claude step can read each PDF with the prompt below, and add PDF.co only if you receive link-only invoices.
  5. Check the first monthCompare the first rows of the sheet against the PDFs before you share the folder with your accountant.

The prompt

The original prompt by Ioana Frincu, word for word, with a link to where it was published. Below it is our adapted version with fill-in blanks, if you want it. Works in n8n and Claude. Values in lime are placeholders.

Original prompt by Ioana Frincu

Word for wordby Ioana Frincu
You are reading a supplier invoice or receipt. Extract:
- supplier_name: legal name of the company that issued the invoice (the seller, not the customer)
- supplier_vat: the seller's VAT / tax ID exactly as printed (e.g. RO12345678, GB150848114)
- issue_date: invoice issue date as YYYY-MM-DD
- amount: total amount payable including VAT, as a number with a dot as decimal separator
- currency: ISO 4217 code, e.g. EUR, RON, USD
Use null for anything that is not on the document. Reply with only this JSON and nothing else:
{"supplier_name": "", "supplier_vat": "", "issue_date": "", "amount": 0, "currency": ""}

Exactly as published by Ioana Frincu in Save, extract, and log email invoices with Gmail, Drive, Sheets, Claude, and PDF.co.

Our adapted version (optional)

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

Adapted prompt2 variables
Read the attached {document_type} and return only JSON with these fields:
supplier_name: the business that issued it (the seller, not {your_company_name})
supplier_tax_id: the seller's VAT or tax number exactly as printed
issue_date: in YYYY-MM-DD
amount_total: the final amount payable after tax, as a number with a dot for decimals
currency: the three-letter ISO code
unclear: a short note if any value was hard to read or there are several candidates, otherwise null
Use null for anything not printed on the document. Do not guess or calculate missing values.

What can go wrong?

  • AI extraction can misread totals or swap the buyer and seller; spot-check amounts and tax IDs, especially on foreign-language invoices.
  • Invoice emails can carry links to pages that ask you to sign in or contain tracking; let the workflow skip anything it cannot render cleanly rather than saving a login screen.
  • A broad Gmail search can file marketing emails as invoices; start narrow and widen it.
  • Sharing a Drive folder exposes every invoice in it; share only the month folder, and only with your accountant.

Our take

This is a clean, well-scoped automation for a chore almost every small business has. The structure is sensible: work out the month from the email date, get a PDF one way or another, extract only what an accountant needs, file it, then label the email so a rerun never duplicates anything. The creator is upfront about the limits, such as login-protected invoices and the need to check early rows. We ran her extraction prompt word for word on four synthetic invoices: a US software vendor billing in USD, a Romanian accounting firm billing in RON, a print-shop receipt with no tax number and a two-page Norwegian invoice where the buyer's VAT number appears before the seller's. It returned valid JSON each time, used null for the missing tax number, converted the European number formats correctly and picked the seller on the two-page invoice. The weak spot was a date printed as 12/10/2026, which it read as 12 October without saying it had assumed day-first order. Our adapted version adds an unclear field for cases like that, so the doubt shows up in your sheet instead of disappearing.

Where the time goes back: Invoices are filed as they arrive, so the month-end hunt through your inbox disappears and your accountant gets a folder and a summary sheet in one share.

FAQ

Which fields does it capture?
Supplier name, the supplier's VAT or tax ID, the issue date, the total including tax and the currency code.
What happens with Stripe or Paddle invoices that arrive as links?
The workflow downloads the linked page and, if it is a web page rather than a PDF, renders it to PDF with PDF.co before filing it.
Do I need to write rules for each supplier?
No, the extraction step reads each invoice as a document, so new suppliers and layouts work without extra setup.

Source and credit

The original prompt on this page is by Ioana Frincu, shown word for word with a link to where it was published. The summary, notes and adapted version are ours.

Original
Save, extract, and log email invoices with Gmail, Drive, Sheets, Claude, and PDF.co
Creator
Ioana Frincu
Published on
n8n workflow templates
Original date
Oct 18, 2026
License
Not openly licensed; the original prompt is shown word for word with credit and a link to the original
Originally for
n8n
AI dry run
Oct 22, 2026: passed. Dry-run tested by our AI test agent on sample input. Extraction correct; silent date assumption is the gap our 'unclear' field covers.
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 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.

Also see: I automated my invoice admin with n8n, and you can copy it (DEV post by the creator) by Ioana Frincu. A related version of the same idea; credited and linked only, nothing from it is reproduced here.

Are you the creator? Claim or correct this page.

More in Finance & Accounting

All 62 Finance & Accounting playbooks →

Related playbooks

Finance & AccountingSkill✓ AI dry run

Have Claude build Excel files that recalculate cleanly

Give Claude the xlsx skill so that any spreadsheet it creates or edits keeps live formulas instead of pasted results, passes a full recalculation with zero formula errors before delivery, labels every assumption with its source, and follows standard financial model conventions or the existing file's own styling.

Credit: Anthropic

Minutes
Finance & AccountingWorkflow✓ AI dry run

Split one big scanned PDF into its separate documents

Turn a bundle of scanned paperwork, such as a stack of invoices saved as one file, into one PDF per document without paging through it to mark where each one ends.

Credit: Jim Le

An afternoon+
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

Turn emailed invoices into rows on a finance sheet

Watch 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.

Credit: u/alexsafari1 on r/n8n

An afternoon+
Finance & AccountingWorkflow✓ AI dry run

Feed latest material costs into your estimates

Watch payables nightly and update estimating formulas with the most recent price paid for each material.

Credit: Joshua Buesking (@jbuesking)

An afternoon+