

How to Log Invoice Receipts from Gmail to Google Sheets with N8n
Automatically extract invoice details from Gmail attachments or emails and log them to a Google Sheets financial tracking spreadsheet.
Steps and UI details are based on platform versions at time of writing — check each platform for the latest interface.
Best for
Teams that receive invoices as PDF attachments and need custom parsing logic for multiple vendor formats.
Not ideal for
Simple invoice workflows where emails contain structured data that doesn't require PDF extraction or custom parsing.
Sync type
pollingUse case type
importReal-World Example
A 25-person marketing agency receives 40-60 vendor invoices per month as PDF attachments from different suppliers — hosting providers, design tools, contractor payments. Before automation, the finance manager spent 3 hours weekly manually entering invoice data into their expense tracking spreadsheet. Now invoices are logged automatically within 5 minutes of arrival, and the finance team only reviews the data for accuracy.
What Will This Cost?
Drag the slider to your expected monthly volume.
Each platform counts differently — Zapier: 1 task per trigger. Make: 1 operation per module per record. n8n: 1 execution per run.





Prices shown for annual billing. Based on published pricing as of April 2026.
Estimated ROI
1000
min saved/mo
$583
labor value/mo
Free
no platform cost
Based on ~2 min manual effort per operation at $35/hr fully loaded labor cost.
Implementation
Import this workflow directly into n8n
Copy the pre-built n8n blueprint and paste it straight into n8n. All modules, filters, and field mappings are already configured — you just need to connect your accounts.
Before You Start
Make sure you have everything ready.
Field Mapping
Map these fields between your apps.
| Field | API Name | |
|---|---|---|
| Required | ||
| Invoice Date | date | |
| Vendor Name | vendor | |
| Invoice Amount | total_amount | |
| Invoice Number | invoice_number | |
2 optional fields▸ show
| Email Subject | email_subject |
| Payment Due Date | due_date |
Step-by-Step Setup
Workflows > New > Gmail Trigger
Connect Gmail to N8n
Set up Gmail trigger to monitor for new emails matching your invoice criteria. You'll authenticate with OAuth and configure the search filter.
- 1Click the + button to add a new node
- 2Search for 'Gmail' and select 'Gmail Trigger'
- 3Click 'Create New' under Credentials
- 4Authorize with your Google account and copy the credentials
Gmail Trigger > Parameters
Configure Email Filter
Set up the Gmail trigger to only fire on emails containing invoices. Use Gmail's search operators to filter by sender domain or subject keywords.
- 1Set Event to 'Message Received'
- 2In the 'Query' field, enter 'subject:invoice OR subject:receipt OR from:billing@'
- 3Set 'Poll Times' to 'Every 5 minutes'
- 4Enable 'Include Attachments'
Gmail Trigger > + > Extract From File
Add Text Extraction Node
Extract invoice data from email body or PDF attachments. N8n's Extract From File node handles PDF parsing automatically.
- 1Add a new node and select 'Extract From File'
- 2Set 'Binary Property' to 'attachment_0'
- 3Choose 'PDF' as file type
- 4Enable 'Extract Tables' option
Extract From File > + > Code
Parse Invoice Fields
Use a Code node with regex or string parsing to extract specific invoice fields like amount, date, and vendor name from the raw text.
- 1Add a 'Code' node after the extraction
- 2Set Language to 'JavaScript'
- 3Paste the invoice parsing code in the editor
- 4Map input data from previous node
Code > + > Google Sheets
Connect Google Sheets
Authenticate with Google Sheets and select your financial tracking spreadsheet. N8n will need edit permissions to append new rows.
- 1Add 'Google Sheets' node
- 2Select 'Append' operation
- 3Create new Google credentials if needed
- 4Choose your target spreadsheet and worksheet
Google Sheets > Parameters > Values to Send
Map Invoice Data to Sheet Columns
Configure which parsed invoice fields go into which spreadsheet columns. Set up proper data formatting for dates and currency amounts.
- 1Set 'Data Mode' to 'Define Below'
- 2Map 'Date' field to column A using {{$node["Code"].json["date"]}}
- 3Map 'Vendor' to column B and 'Amount' to column C
- 4Add 'Invoice Number' and 'Email Subject' mappings
Code > Settings > Continue on Fail
Add Error Handling
Configure what happens when PDF parsing fails or required invoice fields are missing. Set up fallback behavior and error notifications.
- 1Click the Code node and select 'Settings'
- 2Set 'Continue on Fail' to true
- 3Add an 'IF' node after Google Sheets
- 4Configure condition: {{$node["Code"].json["amount"]}} exists
Code > + > Google Sheets (Read) > IF
Set Up Duplicate Prevention
Prevent the same invoice from being logged twice by checking existing Google Sheets rows for matching invoice numbers or email message IDs.
- 1Add 'Google Sheets' node with 'Read' operation before the append node
- 2Search existing rows for matching invoice number
- 3Add 'IF' node to check if invoice already exists
- 4Route new invoices to append, duplicates to ignore
Workflow > Execute Workflow
Test with Real Invoice Email
Send a test invoice email to your Gmail account and verify the workflow extracts fields correctly and logs to the right spreadsheet rows.
- 1Click 'Execute Workflow' button
- 2Send a test email with invoice PDF to your Gmail
- 3Wait 5-10 minutes for Gmail trigger to fire
- 4Check execution log and verify Google Sheets row was added
Workflow > Settings > Active
Activate and Monitor
Turn on the workflow for production use and set up monitoring to catch parsing errors or API failures. Review execution logs weekly.
- 1Click the 'Active' toggle in top right
- 2Set up webhook notifications for failed executions
- 3Configure workflow to run every 5 minutes
- 4Add execution data retention settings
Drop this into an n8n Code node.
JavaScript — Code Node// Enhanced invoice amount parsing that handles multiple currency formats▸ Show code
// Enhanced invoice amount parsing that handles multiple currency formats const text = items[0].json.extractedText; const patterns = [
... expand to see full code
// Enhanced invoice amount parsing that handles multiple currency formats
const text = items[0].json.extractedText;
const patterns = [
/(?:total|amount due)[:\s]+\$?([\d,]+\.\d{2})/i,
/\$([\d,]+\.\d{2})\s*(?:total|due)/i,
/([\d,]+\.\d{2})\s*USD/i
];
for (const pattern of patterns) {
const match = text.match(pattern);
if (match) {
return [{json: {amount: parseFloat(match[1].replace(/,/g, ''))}}];
}
}
return [{json: {amount: null}}];Scaling Beyond 100+ invoices/month+ Records
If your volume exceeds 100+ invoices/month records, apply these adjustments.
Increase Polling Interval
Switch from 5-minute to 15-minute Gmail polling to avoid rate limits. Gmail's API throttles aggressive polling and you'll get 429 errors during busy periods.
Add Batch Processing
Use N8n's SplitInBatches node to process multiple invoices in chunks rather than one at a time. This reduces Google Sheets API calls and prevents timeout errors.
Set Up Queue Management
Add a database or webhook queue between Gmail and processing nodes to handle burst invoice volumes without losing data during API failures.
Going live
Production Checklist
Before you turn this on for real, confirm each item.
Troubleshooting
Common errors and how to fix them.
Frequently Asked Questions
Common questions about this workflow.
Analysis
Use N8n for this if you need custom invoice parsing logic or handle complex PDF layouts that generic automation tools can't parse. N8n's Code nodes let you write custom regex patterns for different vendor formats, and the Extract From File node handles PDF parsing without external APIs. Skip N8n if you only get simple invoice emails (not PDFs) — Zapier's built-in email parsing is faster to set up.
This workflow uses roughly 3-4 executions per invoice: Gmail trigger, PDF extraction, parsing, and Google Sheets write. At 50 invoices/month, that's 200 executions total. N8n's Starter plan ($20/month) includes 5,000 executions, so you're well under the limit. Zapier would cost $29.99/month for the same volume since PDF parsing requires Premium. Make charges per operation and would run about $15/month, making it the cheapest option.
Make's PDF parsing module works better out-of-the-box and handles more invoice formats without custom code. Zapier's Gmail trigger fires faster (usually under 60 seconds vs N8n's 5-minute polling). But N8n wins on flexibility — when you get a weird invoice format that breaks standard parsing, you can fix it with custom JavaScript instead of being stuck with pre-built modules.
You'll hit Gmail API rate limits if you poll too aggressively — stick to 5-minute intervals or longer. PDF extraction fails silently on password-protected files, so add error handling to catch empty results. Invoice parsing breaks when vendors change their PDF layout, which happens more often than you'd expect. Plan to update your regex patterns every few months as new invoice formats appear.
Ideas for what to build next
- →Add Slack notifications for high-value invoices — Send alerts to your finance channel when invoices over $1,000 are received, including vendor name and amount for immediate visibility.
- →Create vendor spending analytics — Build a second workflow that reads your invoice log and generates monthly vendor spending reports with totals and trends analysis.
- →Set up payment due date reminders — Add a scheduled workflow that checks due dates and sends payment reminders 3 days before invoices are due to avoid late fees.
Related guides
How to Share Notion Meeting Notes to Slack with Pipedream
~15 min setup
How to Share Notion Meeting Notes to Slack with Power Automate
~15 min setup
How to Share Notion Meeting Notes to Slack with n8n
~20 min setup
How to Send Notion Meeting Notes to Slack with Zapier
~8 min setup
How to Share Notion Meeting Notes to Slack with Make
~12 min setup
How to Create Notion Tasks from Slack with Pipedream
~15 min setup