workflows.fit
Back to n8n workflows
n8n templateFreeBy Ovadia Rocks

Process scanned invoices with Google Drive, OCR & OpenAI to Google Sheets

This template allows you to automatically process scanned invoices from Google Drive, extract key information using AI, and organize the data in Google Sheets with email notifications. Overview This comprehensive work...

Data & StorageProductivityDevelopmentCore NodesCommunicationAILangchainManual Trigger
Loading interactive preview...

Template notes

This template allows you to automatically process scanned invoices from Google Drive, extract key information using AI, and organize the data in Google Sheets with email notifications.

Overview This comprehensive workflow automates the entire invoice processing pipeline by monitoring a Google Drive folder for new invoice uploads, intelligently processing both PDF and image formats, extracting structured data using AI-powered information extraction, and automatically organizing the results in a Google Sheet while sending email notifications. The system handles various file formats and includes smart fallback mechanisms for challenging documents like CamScanner PDFs.

How it Works

1. File Monitoring: The workflow continuously monitors a specified Google Drive folder for new invoice files using a trigger that checks every minute for newly created files.

2. File Processing: When new files are detected, the system downloads them and determines the file type (PDF or image) using a smart switch mechanism.

3. Text Extraction: - For PDFs: Attempts direct text extraction first - For Images: Uses OCR.Space API for optical character recognition - For problematic PDFs (like CamScanner): Falls back to OCR processing

4. AI Information Extraction: Processes the extracted text through OpenAI's language model to identify and extract key invoice information including: - Company name - Total amount - Currency - Invoice date - Invoice number

5. Data Storage: Automatically appends the extracted information to a Google Sheet with links back to the original scanned documents.