Templates / Organize Gmail attachments in Google Drive folders based on sender’s email

Organize Gmail attachments in Google Drive folders based on sender’s email

Ready for 3.0

by Davide Boizza ✓ · 1,307 views · created 2025-07-22 · File Management

Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 16 nodes and runs on Gmail events (plus 2 other triggers). Along the way it connects Gmail and Google Drive.

How it runs

Trigger: On Gmail events (plus 2 other triggers).

  1. Upload attachment (Google Drive): uses Google Drive
  2. Get emails (Gmail): get many
  3. Loop Over Items (Loop Over Items (Split in Batches)): loops over the items in batches
  4. Get email (Gmail): get
  5. Contain attachments? (If): checks a condition and branches into true / false
  6. Split Out: splits a list into separate items
  7. Search folders (Google Drive): work with file folder
  8. Get attachments (Code): runs custom JavaScript code
  9. Exist? (If): checks a condition and branches into true / false
  10. Merge: merges the data from its input branches

…plus 3 more steps. See the full node list below.

Services it uses

GmailGoogle Drive

Before you upgrade to n8n 3.0

Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.

  • Still check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll) (Gmail Trigger).

Nodes used (12)

From the author

📩🤖 This workflow automatically processes emails received in Gmail, extracts their attachments, and organizes them into specific folders in Google Drive based on the sender's email address. Note: The workflow avoids duplicates by checking folder existence…

Excerpt from Davide Boizza's description on n8n.io.

View the original on n8n.io → Check your own copy

Get the weekly “what broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.