Templates / Extract and validate invoice PDFs with OpenAI, Google Sheets, and Gmail

Extract and validate invoice PDFs with OpenAI, Google Sheets, and Gmail

Ready for 3.0

by isaWOW ✓ · 49 views · created 2026-06-26 · Invoice Processing, AI Summarization

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.

📬 Weekly n8n 3.0 breakage alerts, free

What this workflow does

This workflow has 11 nodes and runs when someone submits an n8n form (“Invoice PDF Processor”). Along the way it connects Google Sheets and Gmail. It also calls api.openai.com over HTTP.

How it runs

Trigger: When someone submits an n8n form (“Invoice PDF Processor”).

  1. 2. Extract From File — PDF to Text (Extract from File): extracts data from a file (pdf)
  2. 3. HTTP — AI Extract Invoice Fields (HTTP Request): calls api.openai.com (POST)
  3. 4. Code — Parse Invoice JSON Safely (Code): runs custom JavaScript code
  4. 5a. Sheets — Log Invoice Header (Google Sheets): append
  5. 5b. Split Out — Line Items (Split Out): splits a list into separate items
  6. 6. Code — Add Unique Key and Line Metadata (Code): runs custom JavaScript code
  7. 7. Sheets — Log Each Line Item (Google Sheets): append
  8. 8. Aggregate — Collect All Line Items (Aggregate): combines items into one
  9. 9. Code — Verify Totals and Build Report (Code): runs custom JavaScript code
  10. 10. Gmail — Send Extraction Report (Gmail): uses Gmail

Services it uses

Google SheetsGmail

HTTP calls to: api.openai.com

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

Check at runtime on n8n 3.0
  • Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Informational: a static scan can't see the data, so test these on your own instance. Status above is unchanged.

Nodes used (8)

From the author

Quick overview This workflow collects an invoice PDF via an n8n Form, extracts text from the PDF, uses OpenAI to convert it into structured invoice JSON, logs invoice headers and line items to Google Sheets, validates totals, and emails a formatted extraction…

Excerpt from isaWOW's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.