Skip to product information

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

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

 (200+Reviews)
Regular price £22.99
Regular price £22.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 PDF Invoice Extraction to Google Sheets with OpenAI (n8n)

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

Regular price £22.99
Regular price £22.99 Sale price
SAVE Sold out

Turn PDF invoices in Gmail into structured rows in Google Sheets—automatically (with OpenAI)

This n8n workflow polls Gmail for unread emails with PDF attachments, extracts invoice data with OpenAI (gpt-4o-mini), and appends a clean, structured record to your Google Sheets Invoices ledger—no manual copy/paste required.

What this workflow does

  • Checks Gmail every 5 minutes for unread emails that include a `PDF` attachment.
  • Downloads the PDF attachment and extracts its text (works with born-digital PDFs that contain a text layer).
  • Sends extracted text to OpenAI using gpt-4o-mini to extract key invoice fields.
  • Outputs results to a strict schema (designed so the model doesn’t invent values).
  • Appends a new row to the Google Sheets document, including invoice fields plus email metadata such as:
    • Received date
    • Sender
    • Filename

Use cases

  • Maintain an always-up-to-date invoice ledger from vendor emails landing in Gmail.
  • Reduce accounts payable processing time by converting invoice PDFs into a Google Sheets dataset.
  • Support SaaS operations teams who need consistent invoice fields for reporting and reconciliation.

Technical details

  • Gmail polling + download: polls for unread emails with PDF attachments, then downloads them.
  • PDF text extraction: extracts text from the attached PDF.
  • OpenAI extraction: uses n8nn8n-nodes-langchainlm chat open ai with gpt-4o-mini and an information extractor node (n8nn8n-nodes-langchaininformation extractor) to produce structured invoice fields.
  • Google Sheets append: appends to the Invoices tab (e.g., columns like ReceivedDate, FromEmail, Vendor, InvoiceNumber, InvoiceDate, DueDate, Net, Tax, Total, Currency, FileName).

Setup & customization

Connect Gmail, OpenAI, and Google Sheets credentials in n8n. Replace YOUR_GOOGLE_SHEET_ID, confirm the sheet name is Invoices, and (optionally) narrow the Gmail search query or extend the extraction schema (e.g., PO number or line items).

View full details