Extract invoice data to Google Sheets with Ollama and Gmail alerts
Ready for 3.0What this workflow does
This workflow has 11 nodes and runs when someone submits an n8n form (“Upload invoice”). Along the way it connects Google Sheets and Gmail.
How it runs
Trigger: When someone submits an n8n form (“Upload invoice”).
- Route by file type (Switch): routes items into 2 branches
- Extract from PDF (Extract from File): extracts data from a file (pdf)
- Convert image to Base (Extract from File): extracts data from a file (binary to propery)
- Ollama: extract from PDF text (HTTP Request): calls an HTTP API (POST)
- Ollama: extract from image (HTTP Request): calls an HTTP API (POST)
- Parse & repair AI output (Code): runs custom JavaScript code
- Validate invoice (Code): runs custom JavaScript code
- Save to Google Sheets (Google Sheets): append
- Needs review? (If): checks a condition and branches into true / false
- Email review alert (Gmail): uses Gmail
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.
Nodes used (8)
- n8n Form Trigger
n8n-nodes-base.formTrigger - Switch
n8n-nodes-base.switch - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - Google Sheets
n8n-nodes-base.googleSheets - If
n8n-nodes-base.if - Gmail
n8n-nodes-base.gmail - Extract from File
n8n-nodes-base.extractFromFile
From the author
Quick overview This workflow lets you upload an invoice (PDF or image), extracts structured invoice data using local Ollama models, validates totals and line items, appends the results to Google Sheets, and sends a Gmail alert when the extracted data needs…