Skip to main content

Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets

Workflow preview

Workflow preview
100%
Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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...

Best for

  • Invoice Processing automation workflows
  • Multimodal AI automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.chainllm, @n8n/n8n-nodes-langchain.lmchatopenrouter, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.googledrive, n8n-nodes-base.httprequest, n8n-nodes-base.telegram

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Budi SJ.

Original n8n.io source

1.1 Workflow description

Title
Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets
Workflow name
Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets

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.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 2 - Set Vision API

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - Basic LLM Chain

Type / Role
@n8n/n8n-nodes-langchain.chainLlm - chainLlm
Config choices
Version 1.7

Block 4 - OpenRouter Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenRouter - lmChatOpenRouter
Config choices
Version 1

Block 5 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 6 - Download file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 7 - HTTP Request

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 8 - Send a text message

Type / Role
n8n-nodes-base.telegram - telegram
Config choices
Version 1.2

Block 9 - Upload file

Type / Role
n8n-nodes-base.googleDrive - googleDrive
Config choices
Version 3

Block 10 - Code

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 11 - Code1

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 12 - Append or update row in sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 13 - On form submission

Type / Role
n8n-nodes-base.formTrigger - formTrigger
Config choices
Version 2.2

Block 14 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets
Complexity advanced
Nodes 17
Categories Invoice Processing, Multimodal AI
Author Budi SJ
Published 12 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7302/7302.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Extract & structure invoice data with Google Vision OCR, Gemini LLM & Google Sheets do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Invoice Processing, Multimodal AI use case.