Automatically Rename Gmail Attachments with GPT-4o and Save to Google Drive
Automatically Rename Gmail Attachments with AI and Save to Google Drive
Who is this for?
This workflow is perfect for anyone who regularly receives important email attachments like reports, invoices, or PDFs and wants them:
Renamed using clean AI generated filenames
Automatically saved to a specific Google Drive folder
Neatly organized without manual work
It is ideal for freelancers, business owners, accountants, and productivity enthusiasts.
What does it solve?
Manually naming and organizing email attachments takes time and often leads to messy files.
This workflow solves that by:
Automatically downloading unread Gmail attachments
Using AI to understand the content and generate clean, consistent filenames
Saving the renamed files to your chosen Google Drive folder
Marking emails as read after processing
No more confusing filenames like "Attachment 1.pdf".
How it works
The workflow runs on a scheduled interval (every hour by default)
It checks Gmail for any unread emails with attachments.
For each email:
Downloads attachments
Extracts and reads PDF content
Uses AI to generate a new filename in the format: YYYYMMDD-keyword-summary.pdf
Saves the file to Google Drive with the new name
Marks the email as read to avoid duplicates
How to set up?
Connect these accounts in your n8n credentials:
Gmail (OAuth2)
Google Drive (OAuth2)
OpenAI (API key)
Update the folder URL in the Google Drive node to your target folder
Optional: adjust the trigger interval if you want it to run more or less often
How to customize this workflow to your needs
Change the AI prompt to create different naming rules, such as including sender or topic
Dynamically set Drive folders based on email sender or subject
Related Templates
AI Email Classifier & Auto-Delete for Gmail (SPAM/OFFER Cleaner)
This workflow is designed for freelancers, solopreneurs, and business owners who receive a high volume of irrelevant mes...
Automatic News Summarization & Email Digest with GPT-4, NewsAPI and Gmail
📰 AI News Digest Agent: Auto News Summarizer & Email Newsletter Create an intelligent news curation system that automat...
Generate Food Recipes from Gmail & Form Requests with Ollama & Llama 3.2
This n8n template demonstrates how to create an intelligent food recipe assistant that accepts requests via Gmail and we...
🔒 Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments