Pull invoice details from email into a sheet and check them
Mohamed Zaghloul shares an n8n workflow where Gemini reads PDF invoices from Gmail into Google Sheets, checks the totals, and flags low-confidence rows.
Done with n8nGemini
What they did
A developer built a free n8n workflow that watches a Gmail label for invoice PDFs. Gemini pulls out the vendor, dates, totals and line items in a strict format. A code step checks that subtotal plus tax equals the total and flags low-confidence rows for review. Rows go into Google Sheets, and the email is marked read so it is not processed twice. He also shows how to add a separate check of bank account and tax numbers.
How it went
The author says setup takes about 10 minutes. He reports that a strict output format and doing the math in code made it more reliable.
Worth knowing
A commenter notes a valid bank number can still be a fraudster's. Treat any change to a vendor's account as needing review, and confirm it by a phone number you already have.
Try it yourself with n8n
Build an n8n workflow that watches my Gmail for unread emails labelled [invoice label] with PDF attachments. For each PDF, extract the vendor, invoice number, dates, currency, subtotal, tax, total, line items and the vendor's bank account number in a strict format. Check in code that subtotal plus tax equals the total, allowing a cent of rounding. Flag uncertain rows as needs review, and flag any vendor whose bank account differs from earlier rows. Append each row to the Invoices tab of [Google Sheet name], then mark the email read. Show me the workflow plan first and wait for my approval before turning it on. Never pay or approve anything automatically.
Swap the highlighted [parts] for your own details.
Source: DEV Community · Mohamed Zaghloul · Oct 18, 2026
Written with AI assistance from the original post and checked against our editorial guidelines. Results are as reported by the source, not independently verified. Spotted a mistake? Tell us.