Skip to product information

Gmail Invoice PDF Extractor with OpenAI to Google Sheets (n8n)

Gmail Invoice PDF Extractor with OpenAI to Google Sheets (n8n)

 (200+Reviews)
Regular price £36.99
Regular price £36.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 Extractor with OpenAI to Google Sheets (n8n)

Gmail Invoice PDF Extractor with OpenAI to Google Sheets (n8n)

Regular price £36.99
Regular price £36.99 Sale price
SAVE Sold out

Extract invoice data from Gmail PDFs and auto-log it into Google Sheets (with OpenAI via n8n)

This n8n workflow watches your Gmail inbox for unread invoice emails with PDF attachments, extracts the invoice text, uses OpenAI (via LangChain) to pull key fields, and appends a structured row into Google Sheets—ready for operational reporting and follow-up.

What this workflow does

  • Monitors Gmail every minute for unread messages that include PDF attachments.
  • Validates the attachment: it downloads and checks that the first attachment is a PDF; non-PDF attachments are ignored.
  • Extracts PDF text: combines the extracted content from the invoice PDF into a single text payload.
  • Uses OpenAI to extract structured fields: sends the extracted text to the LangChain OpenAI Chat Model to identify four invoice values:
    • Vendor name
    • Invoice number
    • Due date
    • Tax-included total
  • Normalizes results into a consistent JSON structure (including converting the total into a number).
  • Appends to Google Sheets in a tab named invoice_lite with headers: torihikisaki_mei, seikyusho_bango, shiharai_kigen, zeikomi_gokei.

Use cases

  • Account receivable teams want to turn emailed PDF invoices into sheet-ready records automatically.
  • SaaS operators managing vendor billing can centralize due dates and totals without manual copy/paste.
  • Automation engineers can deploy a repeatable Gmail-to-Google-Sheets invoice pipeline using OpenAI extraction.

Technical details

  • n8n trigger: Gmail trigger that checks every minute for unread emails with PDF attachments.
  • Validation & logic: filter logic to ensure the first attachment is a PDF.
  • PDF processing: “Extract from file” handling to retrieve and combine text.
  • AI extraction: LangChain OpenAI Chat Model (OpenAI credential required) for field extraction.
  • Data handling: code step to normalize values into a consistent JSON structure before writing.
  • Storage: Google Sheets append into invoice_lite.

Setup requirements: connect Gmail (read unread messages + download attachments), add an OpenAI credential for the LangChain OpenAI Chat Model, create the Google Sheets tab invoice_lite with the specified headers, then send a test email with a PDF invoice—confirming a new row is added.

View full details