Invoice Automation Playbook
Login-walled invoices, pulled, read, checked, and filed on their own with n8n and Gemini.
Founder, OperateAI
- invoices processed / month
- 1,600+ invoices processed / month
- saved every day
- 2.5 hrs saved every day
- duplicate + fake detection
- Auto duplicate + fake detection
Numbers are from the live system over a full month of runs.
The problem
The invoices lived inside vendor portals, and every portal needed its own login. Someone on the team signed into each one, downloaded the PDFs by hand, and typed the vendor, invoice number, date, and total into the accounting sheet.
It ate 150 to 160 minutes a day. Worse, duplicate invoices and lookalike fake ones still slipped through, because catching them depended on a tired human remembering what they had already seen.
How it works
Trigger and pull the invoice list
A Gmail trigger starts the run when an invoice email arrives. n8n then pulls the list of pending invoices from the vendor portal using saved login cookies, so there is no browser session to babysit.
Download each invoice, authenticated
The workflow loops over the pending invoices and downloads each file using the same authenticated session, one by one.
Read it with Gemini
Each invoice image goes to Gemini, which extracts the vendor, invoice number, date, and total into clean structured data, even on messy scans and odd layouts.
Check for duplicates and fakes
A rule check compares every invoice against the master sheet on number, vendor, and amount. Exact repeats and suspicious near-matches get flagged instead of quietly passing through.
File the clean ones, alert on the rest
Verified invoices append straight to the Google master sheet. Flagged ones fire an alert email, so a human only looks at the few that actually need a second pair of eyes.
Built with
Get the workflow
Take the whole thing with you
- The full n8n workflow, import-ready
- The Gemini extraction prompt
- The duplicate and fake-detection logic
- Setup notes for portal logins and the accounting sheet
Bring your own Gemini API key and vendor portal login cookies. Works on n8n cloud or self-hosted.