Automate Gmail attachment saves to Google Drive with Make.com, including deterministic renaming, folder routing, and duplicate-safe logging.
Introduction
You know the loop: an email lands in Gmail, someone downloads the attachment, renames it to something vaguely consistent, and then uploads it into Google Drive. Half the time the filename is missing the reference you need, or the file lands in the wrong folder, or you discover later that the same attachment got uploaded twice.
If you want Cross-Platform Automation (XPA) that actually helps with day-to-day operations, build the workflow once and make it deterministic. In this guide, you will connect Gmail to Google Drive using Make.com, rename each attachment before upload, route it into a structured folder, and keep an audit trail so you can trust what is in Drive.
By the end, you will know how to wire the scenario and map the fields so filenames are consistent, duplicates are avoided, and Slack gets an alert only when something fails.
What You'll Need
- A Gmail account you want to monitor
- Google Drive access, ideally to a dedicated folder structure for incoming email files
- A Google Sheets file for logging processed email IDs and attachment names
- A Make.com account with connections for Gmail, Google Drive, and Google Sheets
- Slack connection plus a channel for error notifications (optional, but recommended)
- Permissions: your Make.com connection must be able to read Gmail attachments and upload files to the target Drive folders
Paid plans: Make.com paid is typically recommended for production because you want execution reliability and enough operation volume for a busy inbox.
How It Works (The Logic)
The scenario does five key things, in order:
- Trigger: When a new Gmail message with attachments matches your filter, Make.com starts.
- Read attachments: Make.com fetches each attachment binary plus attachment metadata like original filename.
- Rename deterministically: Make.com builds a target filename string (date, sender, subject reference, original extension) so Drive filenames are always searchable.
- Upload to the right folder: Make.com uploads the binary to the correct Google Drive folder path.
- Idempotency: Make.com checks Google Sheets to skip already-processed attachments, using a stable key.
Optional branch: if the workflow errors, Make.com posts a Slack alert with the Gmail message ID and what it tried to save.
Step-by-Step Setup
1) Decide what Gmail messages should trigger
In Make.com, choose a Gmail trigger that represents “new messages with attachments.”
Practical pattern that works well:
- Create a Gmail label like
Automation: Save to Drive - Apply it only to emails you want to store (using Gmail filters or manually)
- In Make.com, filter to the label
Why it matters: it prevents the scenario from reprocessing your full inbox when you turn it on.
2) Create a Google Sheets log for duplicates
Create a sheet tab named Processed_attachments with columns like:
gmail_message_idattachment_name_originalattachment_name_savedsaved_drive_urlprocessed_atstatus
This sheet becomes your idempotency layer.
3) Build the Make.com scenario in the right module order
Create a new Make.com scenario, and wire the modules like this:
- Gmail trigger (new email with attachments)
- Gmail action to retrieve attachments (includes attachment binary and filename)
- Google Sheets “search rows” (duplicate check)
- Filter/route: continue only if not already processed
- Tools or Formatter step: build deterministic filename
- Google Drive “upload a file” (with renamed filename)
- Google Sheets “add row” (log success)
- Error handling branch to Slack (optional)
4) Choose the dedupe key, then make it consistent
For file-saving, a reliable key is:
gmail_message_id+attachment_name_original
That combination survives re-sends better than subject lines.
Implementation in Make.com:
- In your Google Sheets search step, search by
gmail_message_id - Then filter inside the scenario for the attachment filename match
If your Sheets search module only supports a single field search, do it in two steps: search by message ID, then filter by attachment name.
5) Build a deterministic filename before upload
Add a Tools/Formatter step before Google Drive upload.
A filename template that works in real teams:
YYYYMMDD_Sender_SubjectRef_OriginalAttachmentName.ext
Inputs you usually map:
YYYYMMDDfrom the Gmail internal date or received date- Sender from the Gmail message “From” (sanitize spaces)
SubjectReffrom a parsed token in the subject, or a fallback likeEMAILOriginalAttachmentName.extto preserve the extension
Gotcha: Drive filenames cannot contain certain characters. Strip or replace anything outside safe characters in your formatter step.
6) Route uploads into structured Google Drive folders
Decide your folder structure now. Examples:
/Incoming/{ClientName}/{YYYY}/{MM}//Incoming/Invoices/{YYYY}/{MM}//Incoming/{MessageType}/{YYYY}/{MM}/
Where do ClientName or MessageType come from? Usually from:
- Parsing a token from the Gmail subject
- Mapping it from a custom part of the email
Then map the folder path dynamically in the Google Drive upload step.
7) Upload the attachment using the renamed filename
In the Google Drive “upload a file” module, map:
- File content: attachment binary from the Gmail attachments step
- File name: your deterministic filename variable
- Folder: your routed folder path
Key principle: rename before upload. That avoids weird “rename after the fact” cleanup.
8) Log the saved file back to Google Sheets
After upload success, add a row in Processed_attachments:
gmail_message_idfrom the Gmail trigger outputattachment_name_originalfrom attachment metadataattachment_name_savedfrom your filename stepsaved_drive_urlfrom the Drive upload outputprocessed_atas the current timestampstatus=success
If your flow supports a “skipped” branch, log status = skipped too. It helps troubleshooting.
9) Add Slack alerts only for errors
Add an error route with a Slack “post a message” step.
Send something like:
- Gmail message subject
- Gmail message ID
- Attachment original name
- Intended Drive folder
- Error message summary
That keeps Slack signal-to-noise high.
10) Test with controlled emails
Test plan:
- Send one email with two attachments
- Confirm both upload once
- Re-send the same email and confirm duplicates are skipped
- Check that Drive filenames follow the deterministic pattern
Then test one failure mode:
- Temporarily break Drive folder permissions to confirm Slack alerts work
Real-World Business Scenario
A property services company receives different document types via email: landlord certificates, signed checklists, utility invoices, and tenant forms. They used this Make.com Gmail-to-Drive automation to automatically file each attachment into a consistent structure like /Incoming/Certificates/2026/05/ and to rename files with a date and property reference extracted from the subject.
Result: fewer missing files in audits, no more “where did you put that PDF” conversations, and a clear log in Google Sheets for tracing what was processed.
If you are also generating PDFs and sending them to clients, the same repeatability mindset applies. You might like this related build for document workflows: generating a PDF from a Google Docs template using Make.com.
Common Variations
1) Split by Gmail labels per document type
Use Gmail labels like Automation: Save to Drive - Invoices and Automation: Save to Drive - Certificates. Route each label to different folder roots.
2) Extract a structured reference and include it in the filename
If the subject always includes tokens like CLIENT-XXXX or INV-####, parse it into a variable and include it in the Drive filename and folder path.
3) Convert files before upload
If you receive Word attachments and want PDFs in Drive, add a conversion step before the Drive upload, then save the converted output with a .pdf extension.
Keeping your file inbox under control
You built a reliable Gmail to Google Drive file pipeline: deterministic renaming, structured folder routing, duplicate safety via Google Sheets logging, and Slack alerts only for real issues.
Olmec Dynamics builds exactly these kinds of operational Cross-Platform Automation (XPA) workflows for businesses. If you want to apply this pattern to your email-to-files process across your stack, start from Cross-Platform Automation (XPA) and see what we do here.