Send specific PDF attachments from Gmail to Google Drive using OpenAI

Send specific PDF attachments from Gmail to Google Drive using OpenAI DISCLAIMER: You may have varying success when using this workflow so be prepared to validate the correctness of OpenAI's results. 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 later processing. This workflow has been de

Integrations Used (4)

Workflow Structure (16 nodes)
100%
Gmail Trigger
On email received
Set
Configure
If
Has attachments?
Code
Iterate over email attachments
If
Is PDF
Read PDF
Read PDF
If
Is text within token limit?
Open Ai
OpenAI matches PDF textual content
Merge
Merge
If
Is matched
No Op
This is a matched PDF
No Op
This is not a matched PDF
Google Drive
Upload file to folder
No Op
There are no attachments
No Op
Not a PDF
No Op
Ignore large PDFs
Node Types:
default
transform
logic
code
action
trigger
Requires credentials

Prerequisites

Required Credentials (3)

Gmail

Used by: On email received

Docs

Google Drive

Used by: Upload file to folder

Docs

OpenAI

Used by: OpenAI matches PDF textual content

Docs

Multiple services required

This workflow needs 3 different credentials. Make sure you have accounts for all services before importing.

Complexity

Advanced

Expert level. Custom code, complex logic, many integrations.

Setup time: ~50 min
Score: 80/100
Custom Code
Conditional Logic
5 Integrations

When to Use This Workflow

Streamline Team Communication

Automatically route notifications and updates to the right channels and people.

Reduce information overload while keeping everyone informed.

Email Automation

Automate email responses, forwarding, or organization based on rules.

Handle routine email tasks automatically and focus on what matters.

Real-time Response

React instantly when events happen - new orders, form submissions, or API calls.

Zero delay between trigger and action for time-sensitive workflows.

workflow.json
{
  "meta": {
    "instanceId": "a2434c94d549548a685cca39cc4614698e94f527bcea84eefa363f1037ae14cd"
  },
  "nodes": [
    {
      "id": "deafa2e8-af41-4f11-92e0-09992f6c6970",
      "name": "Read PDF",
      "type": "n8n-nodes-base.readPDF",
      "position": [
        860,
        1420
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "id": "8e3ddbb1-83a1-4f79-9464-61d5a20f0427",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
...

Workflow Details

Nodes
18
Trigger
Event
Source
awesome
Added
Dec 4, 2025

Need Help?

Check out the official n8n documentation for detailed guides.

Related Workflows

Readpdf Workflow

Automated workflow: Readpdf Workflow. This workflow integrates 11 different services: stickyNote, code, gmailTrigger, re...

Readpdf
Openai
Google-drive
Gmail
19 nodesEvent

Readpdf Workflow

Automated workflow: Readpdf Workflow. This workflow integrates 11 different services: stickyNote, code, gmailTrigger, re...

Readpdf
Openai
Google-drive
Gmail
19 nodesEvent

Analyze Suspicious Email Contents with ChatGPT Vision

![Gmail](https://uploads.n8n.io/templates/gmail.png) Gmail Integration and Data Extraction This section of the workflow...

Gmail
Outlook
Http-request
Openai
18 nodesEvent
Curated

Analyze & Sort Suspicious Email Contents with ChatGPT

![hctiapi](https://uploads.n8n.io/templates/hctiapi2.png) Email Body Screenshot Creation The Screenshot HTML node sends...

Gmail
Outlook
Http-request
Openai
25 nodesEvent
Curated

Send a ChatGPT email reply and save responses to Google Sheets

Configuration If you decide to use your own spreadsheet, it is up to you to ensure all columns are present before runnin...

Openai
Gmail
Google-sheets
Webhook
49 nodesEvent
Curated

Compose reply draft in Gmail with OpenAI Assistant

Reply draft with OpenAI Assistant This workflow automatically transfers content of incoming email messages with specific...

Http-request
Gmail
Schedule
Openai
23 nodesScheduled
Curated