Skip to main content

Invoice verification and validation with Gmail, Drive, Sheets and OCR AI

Workflow preview

Workflow preview
100%
Invoice verification and validation with Gmail, Drive, Sheets and OCR AI preview
Open on n8n.io

Important notice

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

1. Workflow Overview

Description (Full, User Centric & Sales Driven): Tired of manually verifying purchase order invoices every single day? This plug and play n8n automation template saves your accounts team hours o...

Best for

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

Tools used

n8n-nodes-base.extractfromfile, @n8n/n8n-nodes-langchain.lmchatopenrouter, n8n-nodes-base.splitout, n8n-nodes-base.code, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.if, n8n-nodes-base.set, n8n-nodes-base.splitinbatches

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Invoice verification and validation with Gmail, Drive, Sheets and OCR AI
Workflow name
Invoice verification and validation with Gmail, Drive, Sheets and OCR AI

📝 Description (Full, User-Centric & Sales-Driven):

Tired of manually verifying purchase order invoices every single day? This plug-and-play n8n automation template saves your accounts team hours of work by automatically downloading, storing, extracting, and validating invoice data against your master item sheet — all without human intervention.

Perfect for SMEs, startups, procurement teams, and accounts departments, this automation handles PO invoice verification from email to final validation with 99% accuracy.


🚀 What This Automation Does End-to-End:

📥 Invoice Retrieval & Organization:

  • Runs Monday to Saturday, 8 hours/day
  • Reads invoices from specific vendor email(s) (e.g., [email protected])
  • Extracts the invoice date from the email subject
  • Automatically creates month & day-wise folders in Google Drive
  • Uploads each invoice PDF into its respective folder

🔍 AI + OCR Data Extraction & Validation:

  • Uses OCR to extract item data (name, quantity, rate, HSN, etc.) from each invoice PDF
  • Converts messy PDF data into clean structured format using AI Agent Model
  • Stores the data into a dedicated Google Sheet: "Store Invoice Data"

âś… Invoice vs. Master Data Validation:

  • Automatically fetches a second Google Sheet: "Store Master Data"

  • Compares each invoice item line-by-line with the master sheet:

    • Checks for Item Code, Name, Price mismatches
    • Calculates price differences and total loss/gain per invoice
    • Marks each line as Matched / Mismatched with notes

📬 Final Reporting:

  • Sends an automated summary email once all invoices are processed
  • Alerts if any mismatches found, allowing for early intervention

đź“‚ Example Output:

Check how data is validated in real time:


👥 Who Is This For?

  • Accounts & Finance Teams
  • Procurement Departments
  • Growing Startups with Vendors
  • ERP/Automation Enthusiasts
  • Anyone tired of manually checking vendor bills

📦 What You’ll Get:

  • Ready-to-import n8n workflow (JSON)
  • Setup Guide (PDF or Notion link)
  • Sample Google Sheet template
  • Email + Google Drive + OCR setup guide
  • AI Agent configuration tips
  • BONUS: Customization support (optional)

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 - Extract from File

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

Block 2 - OpenRouter Chat Model

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

Block 3 - Split Out

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

Block 4 - Post-Processing

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

Block 5 - Text Extractor

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.8

Block 6 - If

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

Block 7 - Send Raw Text Again

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

Block 8 - Loop Over Items

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

Block 9 - Send Invoice Data

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

Block 10 - Fetch Master Data

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

Block 11 - Update Results

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

Block 12 - Wait

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

Block 13 - Update Totals

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

Block 14 - Get last Index

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

Block 15 - Generate Unique Key

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

Block 16 - Validation

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

Block 17 - Upload Invoices

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

Block 18 - Get Attachments

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

Block 19 - Merge

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

Block 20 - Create Month Folder

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

Block 21 - Create Day Folder

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

Block 22 - Search Month Folder

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

Block 23 - Month Folder Found?

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

Block 24 - Search Day Folder

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

Showing the first 24 of 47 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Invoice verification and validation with Gmail, Drive, Sheets and OCR AI
Complexity advanced
Nodes 47
Categories Invoice Processing, AI Summarization
Author Dhrumil Patel
Published 10 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4860/4860.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 Invoice verification and validation with Gmail, Drive, Sheets and OCR AI do?

Description (Full, User Centric & Sales Driven): Tired of manually verifying purchase order invoices every single day? This plug and play n8n automation template saves your accounts team hours o...

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.