Log Gmail invoice and receipt attachments in Google Sheets
Ready for 3.0What this workflow does
This workflow has 16 nodes and runs on Gmail events. Along the way it connects Gmail and Google Sheets.
How it runs
Trigger: On Gmail events.
- Set sheet URL and search terms (Edit Fields (Set)): sets 4 fields: sheet_url, sheet_name, owner_email…
- Split attachments or use the email body (Code): runs custom JavaScript code
- Is a PDF? (If): checks a condition and branches into true / false
- Extract text from PDF (Extract from File): extracts data from a file (pdf)
- Is a CSV? (If): checks a condition and branches into true / false
- Parse invoice and receipt fields (Code): runs custom JavaScript code
- Extract rows from CSV (Extract from File): extracts data from a file (csv)
- Is an Excel file? (If): checks a condition and branches into true / false
- Ready to log? (If): checks a condition and branches into true / false
- Extract rows from Excel (Extract from File): extracts data from a file (xlsx)
…plus 4 more steps. See the full node list below.
Services it uses
Other Google Sheets + Gmail templates (2,102)
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) (Watch invoice and receipt emails).
Nodes used (8)
- Gmail Trigger
n8n-nodes-base.gmailTrigger - Edit Fields (Set)
n8n-nodes-base.set - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - Extract from File
n8n-nodes-base.extractFromFile - Google Sheets
n8n-nodes-base.googleSheets - No Operation, do nothing
n8n-nodes-base.noOp - Gmail
n8n-nodes-base.gmail
From the author
Quick overview This workflow polls Gmail for unread invoice or receipt emails, extracts text from PDF/CSV/Excel attachments (or uses the email body), parses key billing fields, and logs new entries to a Google Sheets “Invoices” tab, creating a Gmail draft for…