Skip to main content

Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration

Workflow preview

Workflow preview
100%
Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Smart Document Parser for Invoices, Logs or Sensor Reports (PDF/Image to Google Sheets) This n8n workflow automatically parses documents such as invoices, sensor logs or structured PDFs/images (inc...

Best for

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

Tools used

n8n-nodes-base.switch, n8n-nodes-base.googlesheets, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.lmchatgooglegemini, @n8n/n8n-nodes-langchain.chainllm, n8n-nodes-base.webhook, n8n-nodes-base.extractfromfile, n8n-nodes-tesseractjs.tesseractnode

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration
Workflow name
Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration

Smart Document Parser for Invoices, Logs or Sensor Reports (PDF/Image to Google Sheets)

This n8n workflow automatically parses documents such as invoices, sensor logs or structured PDFs/images (including scanned docs or CSVs), extracts key fields like totals, dates and customer/vendor info using OCR and AI, and writes the structured output into Google Sheets.

Who’s it for

  • Finance or Ops teams automating invoice processing.
  • SaaS platforms parsing uploaded reports or documents.
  • Anyone needing a no-code backend for PDF/image/CSV document parsing.
  • AI-powered data capture pipelines.

How it works

  1. Webhook Trigger receives file uploads (/uploadDoc)
  2. Switch Node checks the file type:
    • If image → Use Tesseract OCR
    • If PDF → Use PDF parser
    • If CSV → Extract as-is
  3. Extracted text is passed to:
    • Google Gemini or Gemini Flash AI model
    • Prompt extracts fields like invoice_id, total, customer_name, etc.
  4. JSON string is parsed and cleaned
  5. Data is appended to Google Sheets using appendOrUpdate

How to set up

  1. Create a Google Sheet with columns like:

invoice_id, invoice_date, due_date, customer_name, vendor_name, subtotal, tax_total, total, currency

  1. Connect:
    • Google Sheets OAuth
    • Google Gemini (PaLM API key) for LLM parsing
  2. Deploy the webhook endpoint: /uploadDoc
  3. Upload sample files (PDFs, images, CSVs) to test
  4. Review and map sheet columns in the Invoice Data node

Requirements

Tool Purpose
n8n Automation framework
Google Sheets To store structured output
Tesseract OCR For scanned image text extraction
Google Gemini For natural language parsing

How to customize

  • Add extraction for line items using structured prompts.
  • Change prompt to extract sensor readings, log types, or custom keys.
  • Add support for other file types (e.g., XLSX, DOCX).
  • Add Slack/Email notifications on success/failure.
  • Swap Gemini with OpenAI or Hugging Face if preferred.

Add‑ons

  • Save uploaded files to Google Drive or S3
  • Add auth for secure uploads
  • Use charting/dashboard nodes to visualize extracted data
  • Integrate with billing/accounting software

Use Case Examples

Scenario What Happens
Invoice Upload (PDF) Extracts totals, customer, tax data into a Google Sheet
Scanned Receipt (Image) OCR + LLM extracts structured data
Log File (CSV) Parses and logs entries into Sheets

Common troubleshooting

Issue Possible Cause Solution
Webhook not triggered URL or method mismatch Use correct POST URL /uploadDoc
Text is blank OCR failed Check image quality or Tesseract config
Gemini model not returning JSON Prompt formatting issue Ensure prompt ends with valid JSON schema
Sheet not updated Invalid Sheet ID or tab Double-check sheet credentials and tab name

Need Help?

  • Need help fine-tuning the Gemini prompt for better field accuracy?
  • Want to extract full tables, multi-page invoices or convert PDFs to JSON lines?

Our automation team at WeblineIndia can help you extend this into a full-blown document automation pipeline.

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 - Check file type

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 2 - Invoice data

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

Block 3 - Invoice Data

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

Block 4 - Transfrom data

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

Block 5 - Google Gemini Chat Model

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

Block 6 - Format data from text

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

Block 7 - Webhook Invoice upload

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

Block 8 - PDF to Text

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

Block 9 - Image to Text

Type / Role
n8n-nodes-tesseractjs.tesseractNode - tesseractNode
Config choices
Version 1

Block 10 - CSV to JSON

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

Block 11 - Sticky Note

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

Block 12 - Sticky Note1

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

3. Summary Table

Workflow Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration
Complexity intermediate
Nodes 12
Categories Invoice Processing, Multimodal AI
Author WeblineIndia
Published 11 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/7239/7239.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 Parse invoices & documents with Gemini AI, OCR, and Google Sheets integration do?

Smart Document Parser for Invoices, Logs or Sensor Reports (PDF/Image to Google Sheets) This n8n workflow automatically parses documents such as invoices, sensor logs or structured PDFs/images (inc...

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.