Extract, validate, and log email invoices from Gmail to Google Sheets with GPT-4 — n8n Workflow
Overview
Inbox2Ledger is an end-to-end n8n template that turns a noisy finance inbox into a clean, structured ledger. It fetches emails, uses AI guardrails to keep only finance-relevant messages, extracts invoice/receipt fields via an OCR-style agent, validates and auto-categorizes each expense, generates a unique case ID, and appends the result to a Google Sheet for accounting or downstream automations.
Key Features
Trigger*: Form submission or scheduled fetch (sample *On form submission node included
Nodes used
Workflow Preview
How it Works
- 1
Trigger
The workflow starts with a trigger trigger.
- 2
Process
Data flows through 12 nodes, connecting agent, code, filter.
- 3
Output
The workflow completes its automation and delivers the result to the configured destination.
Node Details (12)
Google Sheets
googleSheets
Gmail
gmail
Code
code
AI Agent
n8n-nodes-langchain.agent
OpenAI Chat Model
n8n-nodes-langchain.lmChatOpenAi
Guardrails
n8n-nodes-langchain.guardrails
How to Import This Workflow
- 1Click Download JSON button on the right to save the workflow file.
- 2Open your n8n instance. Go to Workflows → New → Import from file.
- 3Select the downloaded
extract-validate-and-log-email-invoices-from-gmail-to-google-sheets-with-gpt-4file and click Import. - 4Set up credentials for each service node (API keys, OAuth, etc.).
- 5Click Test Workflow to verify everything works, then activate it.
Or paste directly in n8n → Import from JSON:
Integrations
Created by
Pratyush Kumar Jha
@pratyush
Tags
New to n8n?
n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.
Get n8n Free →