File Gmail invoice attachments to monthly Google Drive folders and Sheets
Ready for 3.0What this workflow does
This workflow has 25 nodes and runs on Gmail events (plus 1 other trigger). Along the way it connects Gmail, Google Sheets, Google Drive and Slack.
How it runs
Trigger: On Gmail events (plus 1 other trigger).
- Invoice filing config (Edit Fields (Set)): sets 12 fields: driveFolderId, subfolderFormat, sheetUrl…
- Crash alert or new emails? (If): checks a condition and branches into true / false
- Format crash alert (Code): runs custom JavaScript code
- Read logged attachments (Google Sheets): uses Google Sheets
- Send alert via (Switch): routes items into 2 branches
- Split attachments and name files (Code): runs custom JavaScript code
- Email the alert (Gmail): send (message)
- Post the alert to Slack (Slack): post (message)
- Fingerprint each file (Crypto): hashes or encrypts values
- Skip files already filed (Code): runs custom JavaScript code
…plus 13 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Google Sheets + Slack templates (1,314) · Other Gmail + Slack templates (957)
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) (New invoice or receipt email).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (11)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Error Trigger
n8n-nodes-base.errorTrigger - Edit Fields (Set)
n8n-nodes-base.set - If
n8n-nodes-base.if - Google Sheets
n8n-nodes-base.googleSheets - Code
n8n-nodes-base.code - Crypto
n8n-nodes-base.crypto - Google Drive
n8n-nodes-base.googleDrive - Gmail
n8n-nodes-base.gmail - Switch
n8n-nodes-base.switch - Slack
n8n-nodes-base.slack
From the author
Quick overview This workflow checks Gmail every 15 minutes for invoice/receipt emails with attachments, uploads approved files to month-based folders in Google Drive, and records each file in a Google Sheets ledger, optionally labeling processed emails in…