Templates / Invoices from Gmail to Drive and Google Sheets

Invoices from Gmail to Drive and Google Sheets

Needs changes

by Juan Carlos Cavero Gracia ✓ · 39,776 views · created 2025-02-25 · Invoice Processing, AI Summarization

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: OpenAI Model. 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This AI workflow has 14 nodes and runs on Gmail events. Along the way it connects Gmail, Google Drive, OpenAI Model and Google Sheets. It also calls googleapis.com over HTTP.

How it runs

Trigger: On Gmail events.

  1. Setup (Edit Fields (Set)): sets 1 field: url_to_drive_folder
  2. Only invoice mails with attachments (If): checks a condition and branches into true / false
  3. Upload PDF to Drive (HTTP Request): calls googleapis.com (POST)
  4. Gmail: mark as read
  5. Rename file (Google Drive): update
  6. Move to the correct folder (Google Drive): move
  7. Google Drive: download
  8. Extract from File: extracts data from a file (pdf)
  9. Apply Data Extraction Rules (Basic LLM Chain): sends a prompt to an LLM, with model: OpenAI Model; output parser: Structured Output Parser
  10. Map Output (Edit Fields (Set)): sets or maps fields

…plus 1 more step. See the full node list below.

Services it uses

GmailGoogle DriveOpenAI ModelGoogle Sheets

HTTP calls to: googleapis.com

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • OpenAI Model: replace with OpenAI Chat Model.
  • Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
OpenAI Model
OpenAI Model
OpenAI Chat Model

Nodes used (11)

From the author

Attachments Gmail to Drive and Google Sheets Description Automatically process invoice emails by saving attachments to Google Drive and extracting key invoice data to Google Sheets using AI. This workflow monitors your Gmail for unread emails with…

Excerpt from Juan Carlos Cavero Gracia'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.