Templates / Process and log Gmail invoices with GPT-4.1-mini, Google Sheets, and Drive

Process and log Gmail invoices with GPT-4.1-mini, Google Sheets, and Drive

Ready for 3.0

by AI Solutions ✓ · 6 views · created 2026-08-18 · 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 AI workflow has 27 nodes and runs on a schedule (every day at 07:00). Along the way it connects Google Sheets, Gmail, OpenAI Chat Model and Google Drive.

How it runs

Trigger: On a schedule (every day at 07:00).

  1. Configure Workflow Settings (Edit Fields (Set)): sets 7 fields: digestTo, spreadsheetId, invoicesSheet…
  2. Fetch Invoices from Sheets (Google Sheets): uses Google Sheets
  3. Retrieve Unread Gmail (Gmail): get many
  4. Decode Gmail Entities (Code): runs custom JavaScript code
  5. Extract Text from PDF Files (Extract from File): extracts data from a file (pdf)
  6. Combine PDF Metadata and Text (Code): runs custom JavaScript code
  7. Extract Fields with AI (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI GPT-4.1-mini
  8. Convert JSON to Invoice Data (Code): runs custom JavaScript code
  9. Identify and Match Vendors (Code): runs custom JavaScript code
  10. Structure Invoice for Sheets (Code): runs custom JavaScript code

…plus 15 more steps. See the full node list below.

Services it uses

Google SheetsGmailOpenAI Chat ModelGoogle Drive

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 (13)

From the author

Quick overview This workflow runs daily, fetches unread Gmail messages, uses OpenAI (GPT-4.1-mini) to classify and extract invoice/receipt fields (including PDF text), saves PDF attachments to Google Drive, logs invoices/receipts to Google Sheets, and emails…

Excerpt from AI Solutions'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.