Intelligent Classification and Upload of Gmail Attachments to Google Drive

This workflow automates the integration of Gmail, Google Sheets, and Google Drive to intelligently classify and store attachments from emails with specific labels. It can automatically identify the sender's company and the email date, dynamically creating corresponding folders and orderly uploading attachments to Google Drive. The process supports the splitting of attachments and adds timestamps to file names, significantly improving file management efficiency. It is suitable for teams in finance, customer service, and legal sectors that require efficient archiving.

Workflow Diagram
Intelligent Classification and Upload of Gmail Attachments to Google Drive Workflow diagram

Workflow Name

Intelligent Classification and Upload of Gmail Attachments to Google Drive

Key Features and Highlights

This workflow automatically monitors a specified Gmail inbox for emails tagged with certain labels, extracts attachments from these emails, and dynamically creates corresponding company folders and year-month subfolders based on the sender’s company and the email date. Attachments are then systematically uploaded to the appropriate directories in Google Drive. It supports splitting multiple attachments to ensure each file is uploaded independently, and prefixes filenames with timestamps for easier management and traceability.

Core Problems Addressed

  • Automates the storage of email attachments, eliminating the need for manual downloading and classification.
  • Ensures attachments are archived in a structured manner by company and date, improving file retrieval efficiency.
  • Uses a whitelist to filter and process emails only from specified senders, enhancing process security and relevance.

Use Cases

  • Automating the organization of invoices, receipts, and other financial documents for corporate finance departments.
  • Automatically archiving customer email attachments for customer service teams to facilitate follow-up.
  • Managing contracts, agreements, and other critical documents automatically in legal, consulting, and similar industries.
  • Any office automation scenario requiring automatic classification and storage of email attachments.

Main Workflow Steps

  1. Gmail Trigger: Polls new emails under a specified label every 15 minutes.
  2. Lookup in Sheets: Searches the Google Sheets whitelist to find company information based on the sender’s email address.
  3. Search Company Folder1 & Company Folder Exists: Checks if the corresponding company folder exists in Google Drive; creates it if not.
  4. YYYY/MM: Generates a year-month formatted subfolder name based on the email date.
  5. Search For Folder & Check If Folder Exists: Checks if the year-month folder exists; creates it if absent.
  6. Gmail: Retrieves email details and attachments.
  7. Split Up Binary Data1: Splits multiple attachments into individual items for separate processing.
  8. Loop Over Items: Processes each attachment in a loop.
  9. Upload To Folder: Uploads each attachment to the corresponding year-month folder, prefixes the filename with a timestamp, and attaches sender and reception time metadata.

Systems and Services Involved

  • Gmail (email trigger and content retrieval)
  • Google Sheets (sender whitelist management and company info lookup)
  • Google Drive (folder management and attachment storage)
  • n8n Automation Platform (workflow orchestration and execution)

Target Users and Value Proposition

  • Enterprises and teams managing large volumes of emails with attachments, especially finance, customer management, and legal departments.
  • Office personnel aiming to reduce manual operations and enhance document archiving standardization and automation.
  • Organizations pursuing digital transformation projects focused on automated classification and storage of email attachments.

This workflow integrates Gmail, Google Sheets, and Google Drive through automation to intelligently classify and archive email attachments, significantly improving office efficiency and ensuring systematic and standardized file management.