Skip to main content

Organize Email Attachments from Gmail to Structured Google Drive Folders

Workflow preview

Workflow preview
100%
Organize Email Attachments from Gmail to Structured Google Drive Folders preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Automated Binary Data Extraction from Gmail to Google Drive Folder This workflow is designed to automate the process of handling emails with binary attachments. It triggers when a new email arrives...

Best for

  • File Management automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, n8n-nodes-base.googledrive, n8n-nodes-base.stickynote, n8n-nodes-base.filter, n8n-nodes-base.gmail, n8n-nodes-base.merge, n8n-nodes-base.splitout

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Organize Email Attachments from Gmail to Structured Google Drive Folders
Workflow name
Organize Email Attachments from Gmail to Structured Google Drive Folders

Automated Binary Data Extraction from Gmail to Google Drive Folder

This workflow is designed to automate the process of handling emails with binary attachments. It triggers when a new email arrives in a specified Gmail account (or can be configured with a similar email trigger) and is set to download any binary attachments. The workflow then filters the email to confirm it contains binary data (attachments). If attachments are present, it proceeds to retrieve the full email details, including all binary data.

A crucial step is the creation of a new Google Drive folder. This folder is dynamically named using the email's subject and the current timestamp, for example, "[Email Subject] - [Current Timestamp]". Following this, the workflow separates each individual attachment from the email. Finally, these attachments are uploaded into the newly created Google Drive folder, with their original filenames preserved. The overall purpose of this workflow is to automatically organize and store email attachments into a structured Google Drive folder system. This workflow is compatible with any type of binary data found in an email, as the filter is designed to detect any binary data, not just PDFs.

How It Works

  1. Trigger: The workflow initiates when a new email arrives in a specified Gmail account. Alternatively, it can be configured with a similar email trigger.

  2. Download Attachments: The workflow is set to automatically download any binary attachments from the incoming email.

  3. Filter Attachments: The workflow then filters the email to confirm it contains binary data (attachments).

  4. Retrieve Full Email Details: If attachments are present, the workflow proceeds to retrieve the complete details of the email, including all binary data.

  5. Create Google Drive Folder: A new folder is created in Google Drive. This folder is dynamically named using the email's subject and the current timestamp (e.g., "[Email Subject] - [Current Timestamp]").

  6. Split Out Attachments: Each individual binary attachment from the email is separated into its own item within the workflow.

  7. Upload to Google Drive: Finally, these separated attachments are uploaded into the newly created Google Drive folder, retaining their original filenames.

Need Help? Have Questions? For consulting and support, or if you have questions, please feel free to connect with me on LinkedIn or email [email protected].

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 - Gmail Trigger

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

Block 2 - Google Drive1

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

Block 3 - Create Folder

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

Block 4 - Sticky Note

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

Block 5 - Filter

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 6 - Gmail1

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 7 - Merge

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

Block 8 - Split Out

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

3. Summary Table

Workflow Organize Email Attachments from Gmail to Structured Google Drive Folders
Complexity intermediate
Nodes 8
Categories File Management
Author Michael Gullo
Published 16 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4977/4977.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 Organize Email Attachments from Gmail to Structured Google Drive Folders do?

Automated Binary Data Extraction from Gmail to Google Drive Folder This workflow is designed to automate the process of handling emails with binary attachments. It triggers when a new email arrives...

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 use case.