Skip to main content

Send specific PDF attachments from Gmail to Google Drive using OpenAI

Workflow preview

Workflow preview
100%
Send specific PDF attachments from Gmail to Google Drive using OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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 re...

Best for

  • File Management automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.readpdf, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.if, n8n-nodes-base.noop, n8n-nodes-base.code, n8n-nodes-base.openai, n8n-nodes-base.merge

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by n8n Team.

Original n8n.io source

1.1 Workflow description

Title
Send specific PDF attachments from Gmail to Google Drive using OpenAI
Workflow name
Send specific PDF attachments from Gmail to Google Drive using OpenAI

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 designed to easily change the search term to match your needs. See the workflow for more details.

Prerequisites

How it works

  1. Triggers off on the On email received node.
  2. Iterates over the attachments in the email.
  3. Uses the OpenAI node to filter out the attachments that do not match the search term set in the Configure node. You could match on various PDF files (i.e. invoice, receipt, or contract).
  4. If the PDF attachment matches the search term, the workflow uses the Google Drive node to upload the PDF attachment to a specific Google Drive folder.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Read PDF

Type / Role
n8n-nodes-base.readPDF - readPDF
Config choices
Version 1

Block 2 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 3 - Configure

Type / Role
n8n-nodes-base.set - set
Config choices
Version 1

Block 4 - Is PDF

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 5 - Not a PDF

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 6 - Is matched

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 7 - This is a matched PDF

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 8 - This is not a matched PDF

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 9 - Iterate over email attachments

Type / Role
n8n-nodes-base.code - code
Config choices
Version 1

Block 10 - OpenAI matches PDF textual content

Type / Role
n8n-nodes-base.openAi - openAi
Config choices
Version 1

Block 11 - Merge

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 2

Block 12 - Upload file to folder

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 2

Block 13 - On email received

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1

Block 14 - Note5

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Ignore large PDFs

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

Block 16 - Is text within token limit?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 17 - Has attachments?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 1

Block 18 - There are no attachments

Type / Role
n8n-nodes-base.noOp - noOp
Config choices
Version 1

3. Summary Table

Workflow Send specific PDF attachments from Gmail to Google Drive using OpenAI
Complexity advanced
Nodes 18
Categories File Management, AI Summarization
Author n8n Team
Published 10 Mar 2023

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/1897/1897.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Send specific PDF attachments from Gmail to Google Drive using OpenAI do?

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 re...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your File Management, AI Summarization use case.