Organize email attachments into Google Drive folders by company with Gmail & Sheets
Needs changesWhat 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.
- Lookup in Sheets (Google Sheets): uses Google Sheets
- Search Company Folder (Google Drive): work with file folder
- Company Folder Exists (If): checks a condition and branches into true / false
- YYYY/MM (Edit Fields (Set)): sets or maps fields
- Create Company Folder (Google Drive): work with folder
- Search For Folder (Google Drive): work with file folder
- Check If Folder Exists (If): checks a condition and branches into true / false
- Gmail: get
- Create Month Folder (Google Drive): work with folder
- Split Up Binary Data (Function): runs custom JavaScript (legacy Function node)
…plus 2 more steps. See the full node list below.
Services it uses
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.0 | Replace with |
|---|---|
| Function (legacy) Split Up Binary Data1 | Code node, mode 'Run Once for All Items' |
Nodes used (8)
- Google Drive
n8n-nodes-base.googleDrive - If
n8n-nodes-base.if - Gmail Trigger
n8n-nodes-base.gmailTrigger - Gmail
n8n-nodes-base.gmail - Function
n8n-nodes-base.function - Edit Fields (Set)
n8n-nodes-base.set - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Google Sheets
n8n-nodes-base.googleSheets
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…