Automated Financial Document Processing with Google Gemini OCR

Go to Workflow
0 views
Built by Didac Fernandez Didac Fernandez
Created on June 08, 2026

Description

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
User uploads PDF invoice via chat interface
File is saved to Google Drive "Invoices" folder
Google Gemini extracts structured data (vendor, amounts, line items, dates)
Data is parsed and saved to "Invoice Records" Google Sheet
File is renamed as "{Vendor Name} - {Invoice Number}"
Confirmation message sent to user

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

Bank Statement Processing Flow
User uploads bank statement to "Bank Statements" folder
Google Gemini extracts multiple transactions from statement
Custom JavaScript parser handles various bank formats
Individual transactions saved to "Bank Transactions Record" Google Sheet

Financial Analysis
Enable the analysis trigger when needed
Ask questions in natural language about your financial data
AI agent accesses all three spreadsheets to provide insights
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.

Nodes Used (8)

AI Agent
@n8n/n8n-nodes-langchain.agent
Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Code
n8n-nodes-base.code
Google Drive
n8n-nodes-base.googleDrive
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured