Log Gmail invoice emails to data tables with Claude Haiku
Ready for 3.0What this workflow does
This workflow has 7 nodes and runs on a schedule (cron 45 6 * * *). Along the way it connects Gmail. It also calls api.anthropic.com over HTTP.
How it runs
Trigger: On a schedule (cron 45 6 * * *).
- Fetch Invoices from Gmail (Gmail): get many (message)
- Create Extraction Prompt (Code): runs custom JavaScript code
- Post to Claude API (HTTP Request): calls api.anthropic.com (POST)
- Validate Extracted Data (Code): runs custom JavaScript code
- Add Invoices to Table (Data table): insert (row)
- Mark Email as Processed (Gmail): add labels (message)
Services it uses
HTTP calls to: api.anthropic.com
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.
Nodes used (5)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - Gmail
n8n-nodes-base.gmail - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - Data table
n8n-nodes-base.dataTable
From the author
Quick overview This workflow runs every morning to find unprocessed invoice-like emails in Gmail, uses Anthropic Claude to extract vendor, total amount, currency, date, and description, then logs each validated invoice into an n8n Data Table and labels the…