Steps
Download the free agent
Get the invoice & receipt logger and run
python3 invoice_logger.py --eml-dir sample_emails --dry-runto see three sample invoices parsed.Connect your mailbox
Set
IMAP_HOST,IMAP_USERand an app password.DAYS=90back-fills the last quarter on the first run.Tune what counts as an invoice
By default, subjects or file names with invoice, receipt, facture, rechnung or order confirmation count. Add
FROM_CONTAINS=stripe,aws,billing@to only log specific senders.Optional: send rows to Google Sheets
Paste the included
google_sheet_webhook.gsinto your Sheet (Extensions → Apps Script), deploy it as a web app, and put the URL inSHEET_WEBHOOK_URL. No Google Cloud project needed.Run it daily
Cron
0 7 * * *, or import the n8n workflow, which adds a Google Sheets row for each new invoice email.
How the amount is found
It looks for the last “total”-style line (grand total, amount due, total paid, montant total…) in the email and in text-based PDFs, and understands $1,049.99, 18,00 € and £24. If there's no total line, it takes the largest amount. It's pattern matching, not AI, so it's free and private, but check the numbers before tax time.
Pair it with the attachment saver
The attachment saver files the PDFs themselves into month/sender folders, and this agent keeps the ledger.
Skip the setup: free download
The Invoice & receipt logger agent does all of this. It's tested, MIT-licensed, and comes as an n8n workflow plus a Python script.
Get the free Invoice & receipt logger agent → Or have us build yours →
FAQ
Does it read scanned PDF invoices?
No. Scans are images, and there's no OCR. The row is still logged with the date and vendor and an empty amount.
Is my data sent anywhere?
Only to your own CSV, and to your own Google Sheet if you set one up. There's no AI API and no third party.
Excel instead of Google Sheets?
The CSV file opens directly in Excel and Numbers.
Related guides
- n8n: log the token usage and cost of every OpenAI call (Google Sheets)
- n8n Google Sheets node not working: Bad request, invalid_grant, private key fixes
- n8n Google Sheets Trigger not working: not firing, activation errors and fixes
- n8n Rename Keys node not working: silent no-ops, lost fields and regex, 28 runs
- n8n Send Email (SMTP) errors: timeouts, 535 Invalid login and SSL fixes, 37 runs
New guides
- GitHub release notifications in Slack (any public repo, stable releases only)
- Send RSS feeds to Slack with a keyword filter (free, incoming webhook)
- Forward emails to a Slack channel (Gmail, Outlook, any IMAP), free with an incoming webhook
- n8n Gmail Trigger not working: not firing, silent errors and fixes