Extract & Structure Invoice Data with Google Vision OCR, Gemini LLM & Google Sheets

Go to Workflow
0 views
Built by Budi SJ Budi SJ
Created on June 05, 2026

Description

Automated Invoice Collection & Data Extraction Using Vision API and LLM

This workflow automates the process of collecting uploaded invoices, extracting text using Google Vision API, and processing the extracted text with an LLM to produce structured data containing key transaction details such as date, voucher number, transaction detail, vendor, and transaction value.
The final data is saved to Google Sheets and a notification is sent to Telegram in real time.

✨ Key Features
Invoice Upload Form**
Users can upload invoice images through a provided form.
Google Drive Integration**
Files are stored in a specified Google Drive folder with a shareable preview link.
OCR via Google Vision API**
Converts invoice images to text using TEXT_DETECTION.
Data Structuring via LLM**
Uses LLM model to parse and structure data.
Structured Output Parser**
Ensures consistent output with required columns.
Data Cleaning**
Cleans and formats numeric values without currency symbols.
Google Sheets Sync**
Appends or updates transaction data in Google Sheets (matched by file ID).
Template: Google Sheets
Telegram Notification**
Sends a transaction summary directly to a Telegram chat/group.

🔐 Required Credentials
Google Vision API Key** → for OCR processing.
OpenRouter API Key** → to access the Gemini Flash LLM.
Google Drive OAuth2** → to upload and download invoice files.
Google Sheets OAuth2** → to write or update spreadsheet data.
Telegram Bot Token** → to send notifications to Telegram.
Telegram Chat ID** → target chat/group for notifications.

🎁 Benefits
Fully automated** from invoice upload to structured reporting.
Time-saving** by eliminating manual transaction data entry.
Real-time integration** with Google Sheets for reporting and auditing.
Instant notifications** via Telegram for quick transaction monitoring.
Duplicate prevention** using file ID as a matching key.
Flexible** for accounting, finance, or administrative teams.

Nodes Used (8)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Drive
n8n-nodes-base.googleDrive
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured
Telegram
n8n-nodes-base.telegram