Automated Gmail Attachment Archiving to Google Drive with Metadata
detail.loadingPreview
Automatically process Gmail attachments, organize them into dated and company-specific folders in Google Drive, and add structured metadata.
About This Workflow
This workflow automates the process of handling email attachments from Gmail. It triggers on new emails with specific labels, extracts attachments, and uploads them to Google Drive. The files are organized into a hierarchical folder structure based on the email's date (YYYY/MM) and the sender's company (looked up from a Google Sheet). Metadata such as sender and reception time is embedded as file properties in Google Drive.
Key Features
- Gmail Trigger: Monitors a specific Gmail label for new emails.
- Attachment Extraction: Downloads and processes attachments from emails.
- Google Sheets Whitelist: Uses a Google Sheet to map sender emails to company names.
- Dynamic Folder Creation: Creates dated folders (YYYY/MM) and company-specific folders in Google Drive if they don't exist.
- File Upload: Uploads attachments to the appropriate Google Drive folder.
- Metadata Embedding: Adds sender email and reception time as custom file properties in Google Drive.
How To Use
- Configure Gmail Trigger: Set up the
Gmail Triggernode to monitor your desired Gmail label and polling interval. Ensure your Google account is connected. - Set Up Google Sheets Whitelist: Create a Google Sheet with 'email' and 'company' columns. Populate it with sender email addresses and their corresponding company names. Configure the
Lookup in Sheetsnode with the correctDocument IDandSheet Name. - Configure Google Drive Storage: The workflow creates a 'Invoices' folder (ID:
18ry0AUtrpp3re6u3zQvvs0BQUGFmBKN9) in your Google Drive as the root for company folders. Ensure this folder exists and your Google Drive account is connected. - Map Sender to Company: The
Lookup in Sheetsnode retrieves the company name based on the sender's email from theGmail Trigger. - Folder Structure Logic:
- The
Search Company Folder1andCompany Folder Existsnodes check if a folder for the identified company already exists within the 'Invoices' parent folder. If not,Create Company Foldercreates it. - The
YYYY/MMnode generates the year and month string (e.g., '2023/10'). - The
Search For FolderandCheck If Folder Existsnodes determine if the YYYY/MM folder exists within the company folder. If not,Create Month Foldercreates it.
- The
- Attachment Handling:
- The
Gmailnode fetches email details, andSplit Up Binary Data1separates each attachment into individual data items. Loop Over Itemsprocesses each attachment individually.
- The
- Upload to Google Drive: The
Upload To Foldernode uploads the attachment to the determined folder. It dynamically sets the file name with a timestamp and embeds sender and reception time as file properties. Ensure thefolderIdcorrectly points to the nested company/date folder structure.
Apps Used
Workflow JSON
{
"id": "d8f34fa1-cd42-4c88-af23-590c323ee505",
"name": "Automated Gmail Attachment Archiving to Google Drive with Metadata",
"nodes": 23,
"category": "File Management",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: d8f34fa1-cd42...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Slack Image Upload Workflow
This workflow automates the process of uploading images from Slack to a public S3 CDN, generating shareable links.
Image to PDF Conversion with Metadata
Converts an image to PDF and generates structured metadata in both English and Chinese.
Send Files to Kindle via Telegram Bot
Automatically send documents received via a Telegram bot to your Kindle email address.