Olmec Dynamics
H
·5 min read

How to Automate Gmail Attachments to Google Drive with Renaming in Make.com

Automate Gmail attachments to Google Drive with Make.com: rename safely, preserve extensions, and avoid duplicates in seconds quickly today.

Automate Gmail attachments to Google Drive with renaming in Make.com

If you regularly download attachments from Gmail and manually file them into Google Drive, the workflow is usually the same: inconsistent filenames, messy duplicates, and too much time spent renaming so you can actually find things later.

With this simple Make.com scenario, you will automate Gmail attachments to Google Drive and rename every attachment as it uploads. You will end up with predictable filenames, preserved extensions, and a basic “processed” safeguard so you do not keep re-importing the same email.

For broader context on Cross-Platform Automation (XPA), see Cross-Platform Automation (XPA).

What You'll Need

  • Make.com account (you may need a paid plan depending on how many emails you process)
  • Gmail connected in Make.com (OAuth permissions)
  • Google Drive connected in Make.com (OAuth permissions)
  • A target Google Drive folder for uploads
  • Optional: a Gmail label to scope which emails get processed

How It Works (The Logic)

When Make.com detects a new Gmail email with attachments, it iterates through each attachment, builds a new filename (based on the email received timestamp plus sender plus sanitized attachment name), and uploads that binary to Google Drive using the computed filename. Finally, it applies a Gmail label (for example Processed-Drive-Archive) so the same email does not get picked up again.

Step-by-Step Setup

1) Create a new Make.com scenario

  • In Make.com, create a new scenario.
  • Name it something like Gmail → Drive (Rename Attachments).

2) Add the Gmail trigger

  • Add a module for Gmail > Watch emails (wording can vary slightly, but you want the trigger that watches new mail).
  • Turn on Has attachments.
  • Add an optional filter like Label is (for example, only emails with a label you control).

Gotcha: if you do not filter, you will ingest far more than intended and your Drive folder becomes a dumping ground.

3) Ensure you process each attachment

  • If the trigger returns attachments as an array, add an appropriate iterator/repeater module so you can handle each attachment individually.

4) Pull the attachment content and original filename

Depending on what your Gmail trigger outputs, you may need a second Gmail module such as Get attachment.

Map these outputs for later steps:

  • Attachment content (the binary)
  • Attachment original filename (or original name)

5) Build a deterministic, safe filename

Add Make modules to compute a rename string.

A pattern that works well for operations teams: YYYYMMDD_HHMMSS_SENDER_OriginalBaseName.EXT

Example: 20260604_143530_JD_Invoice_ABC123.pdf

Field mapping logic:

  1. YYYYMMDD from the Gmail message received timestamp
  2. HHMMSS from the same timestamp for uniqueness
  3. SENDER token, typically initials (for example, JD) or a sanitized short sender string
  4. OriginalBaseName sanitised:
    • replace spaces with _
    • remove or replace characters Drive does not like
  5. EXT preserved from the original attachment filename

Gotcha: preserving the extension is what keeps PDFs, XLSX files, and images opening correctly in downstream tools.

6) Upload to Google Drive using the computed name

Add a module:

  • Google Drive > Upload a file

Set:

  • File name to your computed rename string
  • File content to the Gmail attachment content
  • Destination folder to your chosen Drive folder (use folder ID if your module requires it)

7) Mark the email as processed in Gmail

After a successful upload, add a Gmail action such as:

  • Gmail > Add label to a message

Use a consistent label like Processed-Drive-Archive.

This makes your scenario behave like an XPA that is safe to run repeatedly.

8) Test with 1 email containing multiple attachments

  • Send a test email with multiple attachments.
  • Confirm:
    • each attachment creates a separate Drive file
    • filenames follow your pattern
    • extensions remain correct
    • the email is labelled Processed-Drive-Archive

Real-World Business Scenario

A small accounts team receives invoices and statements via email and stores them in Drive for their finance package. Previously, an admin spent time downloading and renaming files so they matched a monthly naming convention.

After implementing this Make.com Gmail to Drive renaming workflow, every new attachment lands in the right Drive folder immediately with names like 20260604_143530_AM_Invoice_ABC123.pdf. Searching becomes faster, the team avoids overwrites, and the processed label stops re-importing the same email.

Common Variations

  1. Route by Gmail label into different Drive folders
  • If you use labels like Invoices, Receipts, Statements, set a conditional step that selects the Drive folder based on the message label.
  1. Add stronger uniqueness for edge cases
  • If two emails arrive in the same second, add a short suffix using the Gmail message ID fragment.
  1. Write an audit row to Google Sheets
  • After upload, append Gmail message ID, Drive filename, and timestamp into a Google Sheets log so troubleshooting is quick.

What you built, and why it holds up

You built a simple Cross-Platform Automation (XPA) that turns inbound Gmail attachments into organised Google Drive files with consistent, collision-safe renaming. It is the kind of practical integration that keeps ops teams out of manual renaming and reduces operational errors.

If you want this aligned to your exact Gmail filters, Drive folder structure, and naming standards, Olmec Dynamics builds automations like this regularly, you can see what we do here.