Skip to product information

Gmail Invoice PDF to Google Sheets (OpenAI) n8n Workflow

Gmail Invoice PDF to Google Sheets (OpenAI) n8n Workflow

 (200+Reviews)
Regular price ÂŁ12.99
Regular price ÂŁ12.99 Sale price
SAVE Sold out
⬇
Instant Digital Download
∞
Unlimited Downloads
★
Lifetime Access in Your Account
đŸ”„
128+ Sold
Popular with n8n builders
⚡
23 people viewing
High interest right now
✅
9 added today
Fast-moving digital product
Gmail Invoice PDF to Google Sheets (OpenAI) n8n Workflow

Gmail Invoice PDF to Google Sheets (OpenAI) n8n Workflow

Regular price ÂŁ12.99
Regular price ÂŁ12.99 Sale price
SAVE Sold out

Turn Gmail invoice PDFs into validated Google Sheets entries—automatically (with OpenAI)

This n8n workflow monitors your Gmail for supplier invoice emails with PDF attachments, extracts invoice data using OpenAI, validates totals & VAT logic, and then appends clean records to an Invoices tab in Google Sheets—routing any issues to an Exceptions tab for review.

What this workflow does

  • Gmail trigger (every minute): Watches a specified Gmail label for new messages that include attachments, then downloads attachments for processing.
  • PDF filtering: Keeps only PDF attachments from incoming emails.
  • PDF → text conversion: Converts the PDF content into plain text for reliable extraction.
  • OpenAI structured extraction: Sends the extracted text to OpenAI to pull structured invoice fields using a strict schema (supplier, invoice number, dates, currency, totals, VAT, and line items).
  • Validation & reconciliation: Checks required fields, verifies net + VAT ≈ gross, sums line items, ensures VAT rates are allowed, and flags negative totals.
  • Google Sheets output: Appends validated invoices to the Invoices tab; non-reconciling results (including problem details) go to the Exceptions tab.

Use cases

  • SaaS finance ops: Automatically populate an “Invoices” sheet from email PDFs to reduce manual data entry.
  • AP teams & bookkeeping: Catch OCR/extraction errors early by routing mismatches to “Exceptions”.
  • Automation engineers: Use as a template for Gmail + PDF parsing + OpenAI extraction + Google Sheets reconciliation.

Technical details

  • Triggers/Nodes: gmail trigger, filter, code, if, sticky note
  • AI extraction: OpenAI API using an extraction model with a strict schema
  • Spreadsheet storage: Google Sheets (requires an Invoices tab and an Exceptions tab with columns matching extracted fields)

Setup requirements

  • Add Gmail credentials and configure the Gmail label ID.
  • Add OpenAI API credentials.
  • Add Google Sheets credentials and update the spreadsheet URL.
View full details