Automatic Gmail Attachment Archiver to Google Drive - n8n Workflow

Instantly automate the saving of all incoming Gmail attachments directly to a specific Google Drive folder using this efficient n8n workflow. Set up your archiving today.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Business Analysts & Administrators: Users who frequently receive reports, invoices, or critical documents as email attachments and need a central archive.
n8n Automation Engineers: Developers looking for a practical, ready-to-use n8n template demonstrating Gmail and Google Drive integration.
Teams focused on Compliance: Organizations needing verifiable, automated archives of important file transfers.
Productivity Enthusiasts: Individuals seeking to eliminate manual file downloads using a reliable n8n workflow.

Overview

Manually downloading attachments from dozens of daily emails is a massive drain on time and resources. This reliable n8n workflow eliminates that manual process entirely. By leveraging the Gmail n8n trigger, the system constantly monitors your inbox. When a relevant email arrives, this n8n template automatically extracts the attachments and archives them safely within a designated folder in Google Drive. This specific n8n workflow ensures high efficiency and data integrity, offering a seamless 'set-and-forget' solution for document management and file archiving.

How it Works

This powerful n8n workflow starts with the dedicated Gmail Trigger n8n node. This n8n trigger is configured to poll your Gmail inbox at regular intervals (e.g., every minute) looking for new messages.


  1. Trigger Event: A new email is received, and the Gmail Trigger n8n node initializes the workflow.

  2. Conditional Check: The data then flows to the 'If (has Attachments)' n8n node. This node uses the expression {{ $json.attachments.length }} to verify that the received email actually contains one or more attachments. If the length is zero, the workflow stops, preventing unnecessary runs or errors.

  3. File Upload: If attachments are present, the execution path leads to the 'Upload to Google Drive' n8n node. This n8n node takes the file data carried over from the Gmail Trigger and uploads it to the pre-configured Folder ID in your Google Drive. The attachments retain their original filenames, ensuring consistency.

Installation Guide

To deploy and utilize this ready-made n8n template, follow the steps below:


  1. Import the n8n workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' -> 'Import from JSON' function.

  2. Create Gmail Credentials: In n8n, navigate to 'Credentials.' Create a new credential for 'Gmail OAuth2 API' and authenticate with the Google account you wish to monitor. Assign this credential to the 'Gmail Trigger' n8n node.

  3. Create Google Drive Credentials: Create a separate new credential for 'Google Drive OAuth2 API' and authenticate. Assign this credential to the 'Upload to Google Drive' n8n node.

  4. Prepare Google Drive: Go to Google Drive and create the destination folder (e.g., 'Email Archives'). Copy the unique Folder ID from the URL (e.g., the part after /folders/).

  5. Configure the Google Drive n8n Node: Select the 'Upload to Google Drive' n8n node. Replace the placeholder YOURGOOGLEDRIVEFOLDERID in the 'Folder ID' setting with the ID copied in the previous step.

  6. Activate: Save the n8n workflow and click 'Activate' to start the Gmail Trigger. Your automation is now live.

Node Details

This n8n workflow relies on three main n8n nodes for core functionality:

Gmail Trigger:
Function: Serves as the starting n8n trigger, listening for new emails in the selected Gmail account.
Key Configuration: Configured to poll the inbox regularly. It extracts the entire email payload, including the crucial attachments array.

If (has Attachments):
Function: A core logic flow control n8n node that acts as a gatekeeper.
Key Configuration: Uses a condition to check if the length of the attachments array (={{ $json.attachments.length }}) is not equal to 0. Only emails containing attachments proceed to the next step of the n8n workflow.

Upload to Google Drive:
Function: Executes the file storage action, taking the binary attachment data and moving it to the cloud.
* Key Configuration: Requires the specific Folder ID where files should be archived. It automatically utilizes the incoming binary data fields (attachments) provided by the Gmail n8n node to perform the upload.

Related n8n Workflows

Free

Nodes: 4 Nodes
Updated: December 26 2025
View all
Created by
David Olusola
David Olusola

I help ambitious businesses eliminate operational bottlenecks and scale faster with AI automation. My clients typically see 40-60% efficiency gains within 90 days. Currently accepting 3 new projects this quarter - [email protected]

Featured*