Templates / Organize email attachments into Google Drive folders by company with Gmail & Sheets

Organize email attachments into Google Drive folders by company with Gmail & Sheets

Needs changes

by Ventsislav Minev ✓ · 4,491 views · created 2025-04-07 · File Management

Needs changes. This template uses 1 thing(s) that n8n 3.0 removes: Function (legacy). 1 breaking item(s) found. Static check, last run 2026-10-19.

What this workflow does

This workflow has 13 nodes and runs on Gmail events. Along the way it connects Google Drive, Gmail and Google Sheets.

How it runs

Trigger: On Gmail events.

  1. Lookup in Sheets (Google Sheets): uses Google Sheets
  2. Search Company Folder (Google Drive): work with file folder
  3. Company Folder Exists (If): checks a condition and branches into true / false
  4. YYYY/MM (Edit Fields (Set)): sets or maps fields
  5. Create Company Folder (Google Drive): work with folder
  6. Search For Folder (Google Drive): work with file folder
  7. Check If Folder Exists (If): checks a condition and branches into true / false
  8. Gmail: get
  9. Create Month Folder (Google Drive): work with folder
  10. Split Up Binary Data (Function): runs custom JavaScript (legacy Function node)

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

Services it uses

Google DriveGmailGoogle Sheets

Before you upgrade to n8n 3.0

1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:

  • Function (legacy) in Split Up Binary Data1: replace with Code node, mode 'Run Once for All Items'.
  • Also check Gmail Trigger below v1.4 runs as v1.4 (drafts skipped, max emails per poll).

Rather not rewrite it? Many of these flows can be rebuilt in Make (free plan).

Removed in 3.0Replace with
Function (legacy)
Split Up Binary Data1
Code node, mode 'Run Once for All Items'

Nodes used (8)

From the author

Automated Email Attachment Organizer Automatically process labeled emails with attachments into organized Google Drive folders --- Who Is This For? - Teams or Individuals needing to: - Automatically sort invoices, receipts, and files. - Organize client…

Excerpt from Ventsislav Minev'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.