Skip to main content

Gmail attachment manager with Google Drive upload and smart filtering

Workflow preview

Workflow preview
100%
Gmail attachment manager with Google Drive upload and smart filtering 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 n8n template allows you to automatically upload all attached files from incoming emails to Google Drive with optional filters on sender, receiver and file types This template is built to be cu...

Best for

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

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.stickynote, n8n-nodes-base.slack, n8n-nodes-base.gmailtrigger, n8n-nodes-base.filter, n8n-nodes-base.switch, n8n-nodes-base.compression, n8n-nodes-base.httprequest

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Gmail attachment manager with Google Drive upload and smart filtering
Workflow name
Gmail attachment manager with Google Drive upload and smart filtering

This n8n template allows you to automatically upload all attached files from incoming emails to Google Drive with optional filters on sender, receiver and file types

This template is built to be customized for your specific needs. This template has the core logic and n8n node specific references sorted to work with dynamic file names throughout the workflow.

Use cases

  • Store invoices in Google Drive
  • Save recurring reports in Google Drive
  • Post recurring reports to another n8n workflow for further processing
  • Archive files to Google Drive by email
  • Save all files received by a client in a dedicated Google Drive folder

Good to know

  • The workflow is designed to not use custom code, preferring built-in nodes in n8n

How it works

  • Trigger on incoming emails with attachments
  • (Optional) filter on sender/recipient
  • Splits all attachments of the email into separate items
  • (Optional) filter attachment based on file type
  • (Optional) treat attachments with different file types through different paths
  • Upload attachment to Google Drive
  • Mark the email read and archive it after all attachments has been processed
  • Notify in Slack how many attachments was processed in the execution

How to use

  • Configure Google credentials (1,2,6)
  • Configure Slack credentials (7)
  • Configure or disable sender/receiver filter (3)
  • Configure or disable file type filter (4)
  • Configure or disable file type paths (5)
  • Configure destination folder (6)
  • Build on this to fit your use case

Note: there's a similar template with the same basics but with less ready-made modifications and no loop that allows us to archive the email and notify to Slack when done.

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 - Mark read and archive email

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

Block 2 - Sticky Note

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

Block 3 - Send a message

Type / Role
n8n-nodes-base.slack - slack
Config choices
Version 2.3

Block 4 - Trigger on incoming email with attachment

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

Block 5 - Filter based on file type

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

Block 6 - Treat different file types different

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.3

Block 7 - Decompress zip

Type / Role
n8n-nodes-base.compression - compression
Config choices
Version 1.1

Block 8 - Post file to webhook

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Loop attachments

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

Block 10 - Sticky Note1

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

Block 11 - Sticky Note2

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

Block 12 - Sticky Note3

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

Block 13 - Sticky Note4

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

Block 14 - Sticky Note5

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

Block 15 - Sticky Note6

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

Block 16 - Sticky Note7

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

Block 17 - Sticky Note8

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

Block 18 - Sticky Note9

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

Block 19 - Upload file to Google Drive

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

Block 20 - Sticky Note10

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

Block 21 - Filter based on sender or receiver

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

Block 22 - Split Out

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

3. Summary Table

Workflow Gmail attachment manager with Google Drive upload and smart filtering
Complexity advanced
Nodes 22
Categories File Management
Author Ossian Madisson
Published 30 Oct 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/10347/10347.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 Gmail attachment manager with Google Drive upload and smart filtering do?

This n8n template allows you to automatically upload all attached files from incoming emails to Google Drive with optional filters on sender, receiver and file types This template is built to be cu...

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.