Skip to main content

Gmail to Google Drive email export workflow

Workflow preview

Workflow preview
100%
Gmail to Google Drive email export workflow preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Gmail to Google Drive Email Export Workflow (n8n) Overview This n8n workflow automates the process of: 1. Retrieving all emails from a specific sender using Gmail. 2. Extracting essential fie...

Best for

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

Tools used

n8n-nodes-base.gmail, n8n-nodes-base.googledrive, n8n-nodes-base.converttofile, n8n-nodes-base.set, n8n-nodes-base.manualtrigger, n8n-nodes-base.noop, n8n-nodes-base.code, n8n-nodes-base.stickynote

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Gmail to Google Drive email export workflow
Workflow name
Gmail to Google Drive email export workflow

πŸ“¬ Gmail to Google Drive Email Export Workflow (n8n)

🧩 Overview

This n8n workflow automates the process of:

  1. Retrieving all emails from a specific sender using Gmail.
  2. Extracting essential fields like subject, message, and date.
  3. Formatting the email date to the desired time zone (e.g., IST).
  4. Exporting the parsed data as a CSV file.
  5. Uploading the file to a specified folder in Google Drive.

πŸ›  Nodes Breakdown

1. Start Workflow (Manual Trigger)

  • Type: Manual Trigger
  • Purpose: Initiates the workflow manually.

2. Gmail Node (Get All Emails)

  • Type: Gmail
  • Operation: getAll
  • Filters:
  • Returns: All emails from the specified sender.
  • Credentials: Gmail OAuth2 - Akhil

3. Parse Data (Set Node)

  • Purpose: Extracts key fields from the email JSON.
  • Mapped Fields:
    • id: Email ID
    • subject: Email subject
    • message: Email text
    • time: Email date

4. Convert Time Field (Code Node)

  • Purpose: Converts the email time (ISO 8601) to a human-readable format.
  • Output Format:
    • Local time using Asia/Kolkata timezone.
    • Format: "Month Day, Year, Hour:Minute AM/PM"
  • Customizable: Change the timezone as needed:
timeZone: 'Asia/Kolkata'

5. Convert to File

  • Type: Convert to File Node
  • Purpose: Converts JSON data to a downloadable .csv file.
  • Output File: CSV containing id, subject, message, and time.

6. Google Drive

  • Type: Google Drive
  • Purpose: Uploads the generated CSV file to Google Drive.
  • Drive: My Drive
  • Folder: Root
  • File Name: Current timestamp + _n8n_export.csv

7. End Workflow (NoOp)

  • Purpose: Final node to explicitly end the workflow.

βœ… Use Cases

  • Personal Email Archiving: Back up or export emails from a specific sender (e.g., invoices, reports).
  • Audit Logs: Save conversations for compliance.
  • Team Reports: Aggregate project emails into a central file store.

πŸ”§ Customization Guide

Customization How to Do It
Change Sender Email Update the sender field in the Gmail node.
Filter by Date/Subject Add filters in the Gmail node settings.
Change Time Zone Edit timeZone in the Code node.
Add More Email Fields Modify the Set node to include more fields.
Change File Format Use a different format in the Convert to File node.
Rename Output File Adjust the name in the Google Drive node.
Change Upload Folder Set a different folderId in the Google Drive node.

πŸš€ Deployment Tips

  • Schedule the Workflow: Replace Manual Trigger with a Cron node.
  • Avoid Duplicates: Store email IDs and skip duplicates using conditional logic.
  • Security: Use environment variables for sensitive credentials.

πŸ§ͺ Testing Steps

  1. Manually trigger the workflow.
  2. Verify email data is parsed and formatted.
  3. Confirm CSV is generated correctly.
  4. Ensure the file is uploaded to Google Drive.

🧰 Requirements

  • Connected Gmail and Google Drive OAuth2 credentials.
  • n8n instance (self-hosted or cloud).
  • Required nodes available in the n8n environment.

> πŸ’‘ Need more features? You can add: > - Error handling > - Slack/Email notifications > - Conditional filters > - Google Sheets integration instead of Drive

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

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

Block 2 - Google Drive

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

Block 3 - Convert to File

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

Block 4 - Parse Data

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

Block 5 - Start Workflow

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

Block 6 - End Workflow

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

Block 7 - Convert Time Field

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

Block 8 - Sticky Note

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

Block 9 - Sticky Note1

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

Block 10 - Sticky Note2

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

Block 11 - Sticky Note3

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

Block 12 - Sticky Note4

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

Block 13 - Sticky Note5

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

3. Summary Table

Workflow Gmail to Google Drive email export workflow
Complexity intermediate
Nodes 13
Categories File Management
Author Akhil Varma Gadiraju
Published 20 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4236/4236.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 to Google Drive email export workflow do?

Gmail to Google Drive Email Export Workflow (n8n) Overview This n8n workflow automates the process of: 1. Retrieving all emails from a specific sender using Gmail. 2. Extracting essential fie...

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.