Save, extract, and log email invoices with Gmail, Drive, Sheets, Claude, and PDF.co
UnknownWhat this workflow does
This AI workflow has 29 nodes and runs on Gmail events. Along the way it connects Gmail, Google Drive, Anthropic and Google Sheets and 1 more.
How it runs
Trigger: On Gmail events.
- Settings (Edit Fields (Set)): sets 3 fields: invoicesFolderId, filePreviousMonth, renderLinkDomains
- Compute accounting month (Code): runs custom JavaScript code
- Loop over emails (Loop Over Items (Split in Batches)): loops over the items in batches
- Find year folder (Google Drive): work with file folder
- Year folder exists? (If): checks a condition and branches into true / false
- Year folder ID (Edit Fields (Set)): sets 1 field: yearFolderId
- Create year folder (Google Drive): work with folder
- Find month folder (Google Drive): work with file folder
- Month folder exists? (If): checks a condition and branches into true / false
- Collect invoice files (Code): runs custom JavaScript code
…plus 17 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102) · Other Google Drive + Google Sheets templates (720) · Other Gmail + Google Drive templates (465)
Before you upgrade to n8n 3.0
We can't fully verify this one: it relies on 1 community package, and n8n 3.0 turns unverified community packages off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).
- Check that n8n-nodes-pdfco is verified or supports 3.0 (used in Render page as PDF).
- Code node: the task timeout drops from 300s to 60s. Test with a realistic data volume.
Nodes used (12)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - Google Drive
n8n-nodes-base.googleDrive - If
n8n-nodes-base.if - Loop Over Items (Split in Batches)
n8n-nodes-base.splitInBatches - Gmail
n8n-nodes-base.gmail - PDFco Api
n8n-nodes-pdfco.PDFco Api - HTTP Request
n8n-nodes-base.httpRequest - No Operation, do nothing
n8n-nodes-base.noOp - Anthropic
@n8n/n8n-nodes-langchain.anthropic - Google Sheets
n8n-nodes-base.googleSheets
From the author
Quick overview This workflow checks Gmail for invoice emails, saves PDF invoices to Google Drive in automatically created YYYY/YYYY-MM folders, extracts key invoice fields with Anthropic Claude, and logs each invoice in a monthly Google Sheets spreadsheet…