Skip to main content

Extract invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini

Workflow preview

Workflow preview
100%
Extract invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini preview
Open on n8n.io

1. Workflow Overview

This template is designed for operations, finance, and accounting teams that need to automatically process scanned invoices and extract structured data without manual entry. It is ideal for busines...

Best for

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

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.wait, @n8n/n8n-nodes-langchain.informationextractor, @n8n/n8n-nodes-langchain.lmchatgooglegemini, n8n-nodes-base.stickynote, n8n-nodes-base.formtrigger, n8n-nodes-base.merge, n8n-nodes-base.compression

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Extract invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini
Workflow name
Extract invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini

This template is designed for operations, finance, and accounting teams that need to automatically process scanned invoices and extract structured data without manual entry.

It is ideal for businesses handling vendor invoices, reimbursement forms, or bulk document intake.

What this workflow does

This workflow uses Sarvam AI Vision model to perform OCR on scanned invoices and extract raw text. The extracted content is then processed using an LLM to identify key invoice fields such as:

  • Vendor name
  • Invoice number
  • Invoice date
  • Total amount
  • GST / Tax amount

The structured data is automatically appended to Google Sheets for tracking, reconciliation, or downstream accounting automation.

Requirements

  • Sarvam Vision API key (configured using HTTP Header credentials)-(https://dashboard.sarvam.ai/key-management)
  • Google Gemini API key (configured via Google Gemini credentials in n8n)
  • Google Sheets OAuth credentials

How to set up

1.) Add your Sarvam API key in Credentials. 2.) Connect your Google Sheets account. 3.) Update the target Sheet ID. 4.)Test with a sample invoice PDF.

Need Help?

ask in the Forum!

Happy Hacking!

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 - Get OCR Result

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

Block 2 - Wait

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 3 - Information Extractor

Type / Role
@n8n/n8n-nodes-langchain.informationExtractor - informationExtractor
Config choices
Version 1.2

Block 4 - Google Gemini Chat Model

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

Block 5 - Sticky Note5

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

Block 6 - Sticky Note7

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

Block 7 - Sticky Note6

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

Block 8 - Sticky Note8

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

Block 9 - Sticky Note9

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

Block 10 - Sticky Note10

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

Block 11 - Sticky Note11

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

Block 12 - Trigger – Invoice upload (PDF)

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

Block 13 - Create Sarvam invoice OCR job

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

Block 14 - Generate Sarvam presigned upload URL

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

Block 15 - Merge job details with upload URL

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

Block 16 - Upload invoice PDF to Sarvam

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

Block 17 - Start Sarvam invoice OCR

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

Block 18 - Check Sarvam OCR status

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

Block 19 - Download Sarvam OCR output ZIP

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

Block 20 - Decompress OCR result file

Type / Role
n8n-nodes-base.compression - compression
Config choices
Version 1.1

Block 21 - Extract invoice OCR JSON

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

Block 22 - Prepare invoice text for LLM

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

Block 23 - Append extracted invoice data to Google Sheets

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

3. Summary Table

Workflow Extract invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini
Complexity advanced
Nodes 23
Categories Invoice Processing, AI Summarization
Author Divyanshu Gupta
Published 28 Feb 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/13779/13779.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 invoice data from scanned PDFs to Google Sheets with Sarvam and Gemini do?

This template is designed for operations, finance, and accounting teams that need to automatically process scanned invoices and extract structured data without manual entry. It is ideal for busines...

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, AI Summarization use case.