Templates / Send specific PDF attachments from Gmail to Google Drive using OpenAI

Send specific PDF attachments from Gmail to Google Drive using OpenAI

Needs changes

by n8n Team ✓ · 22,117 views · created 2023-03-10 · File Management, AI Summarization

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

What this workflow does

This workflow has 16 nodes and runs on Gmail events. Along the way it connects Google Drive and Gmail.

How it runs

Trigger: On Gmail events.

  1. Configure (Edit Fields (Set)): sets or maps fields
  2. Has attachments? (If): checks a condition and branches into true / false
  3. Iterate over email attachments (Code): runs custom JavaScript code
  4. Is PDF (If): checks a condition and branches into true / false
  5. Read PDF: uses Read PDF
  6. Is text within token limit? (If): checks a condition and branches into true / false
  7. OpenAI: uses OpenAI
  8. Merge: merges the data from its input branches
  9. Is matched (If): checks a condition and branches into true / false
  10. Upload file to folder (Google Drive): uses Google Drive

Services it uses

Google DriveGmail

Before you upgrade to n8n 3.0

2 things in this workflow are removed in n8n 3.0. Fix them before you upgrade:

  • Read PDF: replace with Extract from File node, 'Extract From PDF' operation.
  • OpenAI (legacy) in OpenAI matches PDF textual content: replace with OpenAI node (AI section).
  • 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
Read PDF
Read PDF
Extract from File node, 'Extract From PDF' operation
OpenAI (legacy)
OpenAI matches PDF textual content
OpenAI node (AI section)

Nodes used (9)

From the author

This workflow reads PDF textual content and sends the text to OpenAI. Attachments of interest will then be uploaded to a specified Google Drive folder. For example, you may wish to send invoices received from an email to an inbox folder in Google Drive for…

Excerpt from n8n Team'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.