Send specific PDF attachments from Gmail to Google Drive using OpenAI
Needs changesNeeds 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.
- Configure (Edit Fields (Set)): sets or maps fields
- Has attachments? (If): checks a condition and branches into true / false
- Iterate over email attachments (Code): runs custom JavaScript code
- Is PDF (If): checks a condition and branches into true / false
- Read PDF: uses Read PDF
- Is text within token limit? (If): checks a condition and branches into true / false
- OpenAI: uses OpenAI
- Merge: merges the data from its input branches
- Is matched (If): checks a condition and branches into true / false
- Upload file to folder (Google Drive): uses Google Drive
Services it uses
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.0 | Replace 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)
- Read PDF
n8n-nodes-base.readPDF - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp - Code
n8n-nodes-base.code - OpenAI
n8n-nodes-base.openAi - Merge
n8n-nodes-base.merge - Google Drive
n8n-nodes-base.googleDrive - Gmail Trigger
n8n-nodes-base.gmailTrigger
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…