Skip to main content

Automated financial document processing with Google Gemini OCR

Workflow preview

Workflow preview
100%
Automated financial document processing with Google Gemini OCR preview
Open on n8n.io

Important notice

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

1. Workflow Overview

AI Powered Financial Document Processing with Google Gemini This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expens...

Best for

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

Tools used

@n8n/n8n-nodes-langchain.chattrigger, n8n-nodes-base.splitout, n8n-nodes-base.stickynote, n8n-nodes-base.set, n8n-nodes-base.httprequest, n8n-nodes-base.googlesheets, n8n-nodes-base.executeworkflowtrigger, n8n-nodes-base.merge

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Automated financial document processing with Google Gemini OCR
Workflow name
Automated financial document processing with Google Gemini OCR

AI-Powered Financial Document Processing with Google Gemini

This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expense receipts into a folder, or add bank statements - the system automatically extracts, categorizes, and organizes all your financial data into structured Google Sheets.

What this workflow does

Processes three types of financial documents automatically:

  • Invoice Processing: Upload PDF invoices through a chat interface and get structured data extraction with automatic file organization
  • Expense Management: Monitor a Google Drive folder for new receipts and automatically categorize expenses using AI
  • Bank Statement Processing: Extract and organize transaction data from bank statements with multi-transaction support
  • Financial Analysis: Query all your financial data using natural language with an AI agent

Key Features

  • Multi-AI Persona System: Four specialized AI personas (Mark, Donna, Victor, Andrew) handle different financial functions
  • Google Gemini Integration: Advanced document understanding and data extraction from PDFs
  • Smart Expense Categorization: Automatic classification into 17 business expense categories using LLM
  • Real-time Monitoring: Continuous folder watching for new documents with automatic processing
  • Natural Language Queries: Ask questions about your financial data in plain English
  • Automatic File Management: Intelligent file naming and organization in Google Drive
  • Comprehensive Error Handling: Robust processing that continues even when individual documents fail

How it works

Invoice Processing Flow

  1. User uploads PDF invoice via chat interface
  2. File is saved to Google Drive "Invoices" folder
  3. Google Gemini extracts structured data (vendor, amounts, line items, dates)
  4. Data is parsed and saved to "Invoice Records" Google Sheet
  5. File is renamed as "{Vendor Name} - {Invoice Number}"
  6. Confirmation message sent to user

Expense Processing Flow

  1. User drops receipt PDF into "Expense Receipts" Google Drive folder
  2. System detects new file within 1 minute
  3. Google Gemini extracts expense data (merchant, amount, payment method)
  4. OpenRouter LLM categorizes expense into appropriate business category
  5. All data saved to "Expenses Recording" Google Sheet

Bank Statement Processing Flow

  1. User uploads bank statement to "Bank Statements" folder
  2. Google Gemini extracts multiple transactions from statement
  3. Custom JavaScript parser handles various bank formats
  4. Individual transactions saved to "Bank Transactions Record" Google Sheet

Financial Analysis

  1. Enable the analysis trigger when needed
  2. Ask questions in natural language about your financial data
  3. AI agent accesses all three spreadsheets to provide insights
  4. Get reports, summaries, and trend analysis

What you need to set up

Required APIs and Credentials

  • Google Drive API - For file storage and monitoring
  • Google Sheets API - For data storage and retrieval
  • Google Gemini API - For document processing and data extraction
  • OpenRouter API - For expense categorization (supports multiple LLM providers)

Google Drive Folder Structure

Create these folders in your Google Drive:

  • "Invoices" - Processed invoice storage
  • "Expense Receipts" - Drop zone for expense receipts (monitored)
  • "Bank Statements" - Drop zone for bank statements (monitored)

Google Sheets Setup

Create three spreadsheets with these column headers:

Invoice Records Sheet: Vendor Name, Invoice Number, Invoice Date, Due Date, Total Amount, VAT Amount, Line Item Description, Quantity, Unit Price, Total Price

Expenses Recording Sheet: Merchant Name, Transaction Date, Total Amount, Tax Amount, Payment Method, Line Item Description, Quantity, Unit Price, Total Price, Category

Bank Transactions Record Sheet: Transaction ID, Date, Description/Payee, Debit (-), Credit (+), Currency, Running Balance, Notes/Category

Use Cases

  • Small Business Accounting: Automate invoice and expense tracking for bookkeeping
  • Freelancer Financial Management: Organize client invoices and business expenses
  • Corporate Expense Management: Streamline employee expense report processing
  • Financial Data Analysis: Generate insights from historical financial data
  • Bank Reconciliation: Automate transaction recording and account reconciliation
  • Tax Preparation: Maintain organized records with proper categorization

Technical Highlights

  • Expense Categories: 17 predefined business expense categories (Cost of Goods Sold, Marketing, Payroll, etc.)
  • Multi-format Support: Handles various PDF layouts and bank statement formats
  • Scalable Processing: Processes multiple documents simultaneously
  • Error Recovery: Continues processing even when individual documents fail
  • Natural Language Interface: No technical knowledge required for financial queries
  • Real-time Processing: Documents processed within minutes of upload

Benefits

  • Time Savings: Eliminates manual data entry from financial documents
  • Accuracy: AI-powered extraction reduces human error
  • Organization: Automatic file naming and categorization
  • Insights: Query financial data using natural language
  • Compliance: Maintains organized records for accounting and audit purposes
  • Scalability: Handles growing document volumes without additional overhead

This workflow transforms tedious financial document processing into an automated, intelligent system that grows with your business needs.

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 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - Split Out

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

Block 3 - Sticky Note1

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

Block 4 - Confirmation

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

Block 5 - Parsed Data

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

Block 6 - Upload PDF to Google Gemini

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

Block 7 - Download Data from Google Gemini

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

Block 8 - Table ERP

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

Block 9 - When Executed by Another Workflow

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

Block 10 - Merge

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

Block 11 - Update File Name

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

Block 12 - Save Invoice

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

Block 13 - Sticky Note

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

Block 14 - Sticky Note2

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

Block 15 - Sticky Note3

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

Block 16 - Google Drive Trigger

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

Block 17 - Split Out1

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

Block 18 - Parsed Data1

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

Block 19 - Upload PDF to Google Gemini1

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

Block 20 - Download Data from Google Gemini1

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

Block 21 - Google Sheets

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

Block 22 - Google Drive

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

Block 23 - Sticky Note4

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

Block 24 - Sticky Note5

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

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

3. Summary Table

Workflow Automated financial document processing with Google Gemini OCR
Complexity advanced
Nodes 76
Categories Invoice Processing, AI RAG
Author Didac Fernandez
Published 28 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/9054/9054.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 Automated financial document processing with Google Gemini OCR do?

AI Powered Financial Document Processing with Google Gemini This comprehensive workflow automates the complete financial document processing pipeline using AI. Upload invoices via chat, drop expens...

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 RAG use case.