๐Ÿ“ Gmail to Google Drive email export workflow

โšก 1,768 views ยท ๐Ÿ“ File Management

Description

๐Ÿ“ฌ 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)


2. Gmail Node (Get All Emails)


3. Parse Data (Set Node)


4. Convert Time Field (Code Node)

timeZone: 'Asia/Kolkata'

5. Convert to File


6. Google Drive


7. End Workflow (NoOp)


โœ… Use Cases


๐Ÿ”ง Customization Guide

CustomizationHow to Do It
Change Sender EmailUpdate the sender field in the Gmail node.
Filter by Date/SubjectAdd filters in the Gmail node settings.
Change Time ZoneEdit timeZone in the Code node.
Add More Email FieldsModify the Set node to include more fields.
Change File FormatUse a different format in the Convert to File node.
Rename Output FileAdjust the name in the Google Drive node.
Change Upload FolderSet a different folderId in the Google Drive node.

๐Ÿš€ Deployment Tips


๐Ÿงช 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


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

๐Ÿ”— Nodes Used

Google Drive, Gmail, Convert to File

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup