n8n • Gmail • Google Drive • PDF

How to Automatically Save Gmail PDF Attachments to Google Drive with n8n

Hands-on tested • Updated August 22, 2026

We built this workflow in n8n Cloud from scratch, published it, sent a fresh PDF by email, and verified that Google Drive received the renamed file automatically.

Verified result

invoice.pdf2026-08-22_invoice.pdf in Google Drive, without pressing the manual Execute button.

Start n8n Cloud free trial →Is n8n right for you? →

n8n link status: standard non-affiliate link. Our affiliate application was not approved.

n8n workflow with Gmail Trigger connected to Google Drive Upload file
The core workflow is compact: Gmail Trigger → Google Drive Upload file.

What this n8n workflow does

1. Detect
Poll Gmail for a new message that has a PDF attachment.
2. Download
Expose the attachment as binary data inside n8n.
3. Rename & archive
Add the date to the original filename and upload the PDF to Google Drive.

Before you start

You need an n8n Cloud account, Gmail, and Google Drive. We used the n8n Cloud trial for this test. During our trial, the dashboard showed 14 days remaining and a 1,000-execution allowance.

Use a non-sensitive test PDF while connecting Gmail. Google asks you to approve Gmail permissions for n8n Cloud. Remove the connection later if you no longer need it.

Step 1 — Add Gmail Trigger

  1. Create a new workflow and add Gmail Trigger.
  2. Choose Message Received.
  3. Connect the Gmail account you want n8n to monitor.
  4. Leave the poll interval at Every Minute while testing.

Step 2 — Filter for PDF attachments

Under Filters → Search, we used the same syntax that works in Gmail search:

has:attachment filename:pdf

This keeps the trigger focused on messages with PDF attachments instead of processing every incoming email.

Step 3 — Turn off Simplify and download the attachment

This was the key setting in our test. With Simplify enabled, the trigger returned the message metadata but not the attachment binary. We turned Simplify off, then added Download Attachments under Options.

n8n Gmail Trigger binary output showing attachment_0 test.pdf application pdf
After enabling Download Attachments, n8n exposed attachment_0 with filename, MIME type, and file size.
What we saw

attachment_0test.pdfapplication/pdf • about 384 kB.

Step 4 — Add Google Drive “Upload file”

Add a Google Drive node after Gmail Trigger and choose File → Upload. Connect your Google Drive account.

The critical mapping is Input Data Field Name. Because our Gmail attachment appeared as attachment_0, we entered:

attachment_0

If your binary property has a different name, use the name shown in your Gmail Trigger Binary output.

Step 5 — Preserve the original filename

For the Drive File Name field, switch from Fixed to Expression and use:

{{ $binary.attachment_0.fileName }}

In our test, n8n evaluated that expression to test.pdf.

Step 6 — Add the current date automatically

We then changed the filename expression to:

{{ $now.toFormat('yyyy-MM-dd') + '_' + $binary.attachment_0.fileName }}

The preview immediately returned 2026-08-22_test.pdf.

n8n expression that adds YYYY-MM-DD before the original attachment filename
The expression preview confirms the final filename before the upload runs.

Step 7 — Test the Google Drive upload

Executing the Drive node returned a Google Drive file ID, MIME type, and view link. The output name was 2026-08-22_test.pdf.

n8n Google Drive upload success output for a renamed PDF
The Drive node returned the uploaded file metadata, confirming the renamed PDF was created.

A temporary Drive API quota error we hit

On one test run, Google Drive returned a requests-per-minute quota error. We did not change the workflow. After waiting briefly and retrying once, the same node completed successfully. If you see a quota message, avoid repeatedly clicking Execute.

Step 8 — Publish and test the real automation

Manual node tests are not enough for a hands-on automation guide. We published the workflow, sent a new file named invoice.pdf, and waited for the Gmail trigger.

The workflow ran automatically and Google Drive received:

Final production test

2026-08-22_invoice.pdf

Google Drive file named 2026-08-22_invoice.pdf created by n8n
The final file created by the published workflow.

Why this felt different from Make and Zapier

For this specific workflow, n8n let us keep the core flow visually small while putting the filename transformation directly into an expression. That is powerful, but it assumes you are comfortable reading expressions such as $binary.attachment_0.fileName.

Make is more visual when you start adding routers and filters. Zapier is approachable for linear app-to-app workflows, but our tested Zap became more step-heavy when we added date formatting and a Sheets log.

n8n Cloud pricing context

As of August 2026, n8n lists Cloud Starter at €20/month when billed annually, with 2,500 workflow executions and unlimited steps. n8n says paid plans are priced around completed workflow executions rather than charging separately for every step in a workflow.

Source: n8n official pricing. Pricing can change, so verify the current plan before subscribing.

Want to try the same workflow?

Start with n8n Cloud, reproduce the Gmail → Drive flow, and only move to a paid plan if the execution model fits your workload.

Disclosure: the n8n link on this page is currently a standard non-affiliate link. If that changes, we will update this disclosure.

Related n8n guides

n8n tool guide

Who n8n fits, pricing context, and what stood out in our hands-on test.

Explore n8n →

Make vs n8n

See where the same Gmail-to-Drive use case felt different in each platform.

Compare →

Bottom line

n8n successfully handled the full path from Gmail PDF detection to a renamed Google Drive file in our live test. The strongest part was flexibility: the date-based rename required only an expression instead of a separate formatting node. The trade-off is that n8n exposes more technical concepts than beginner-first tools.