Automate invoice data extraction from Google Drive to Airtable using Nanonets OCR & Command-R
$20/month : Unlimited workflows
2500 executions/month
THE #1 IN WEB SCRAPING
Scrape any website without limits
HOSTINGER 🎉 Early Black Friday Deal
DISCOUNT 20% Try free
DISCOUNT 20%
Self-hosted n8n
Unlimited workflows - from $4.99/mo
#1 hub for scraping, AI & automation
6000+ actors - $5 credits/mo
How it works
This template creates a fully automated "hands-off" pipeline for processing financial documents. It's perfect for small businesses, freelancers, or operations teams who want to stop manually entering invoice and receipt data.
When you drop a new image/multiple images file into a specific Google Drive folder, this workflow automatically:
- Triggers and downloads the new file.
- Performs OCR on the file using a local AI model (
Nanonets-OCR-s) to extract all the raw text. - Cleans & Structures the raw text using a second local AI model (
command-r7b). This step turns messy text into a clean, predictable JSON object. - Saves the structured data (like
InvoiceNumber,TotalAmount,IssueDate, etc.) to a new record in your Airtable base. - Moves the original file to a "Done" or "Failed" folder to keep your inbox clean and organized.
Requirements
- Google Drive Account: For triggering the workflow and storing files.
- Airtable Account: To store the final, structured data.
- Ollama (Local AI): This template is designed to run locally for free. You must have Ollama running and pull two models from your terminal:
ollama pull benhaotang/Nanonets-OCR-s:F16ollama pull command-r7b:7b-12-2024-q8_0
How to set up
Setup should take about 10-15 minutes. The workflow contains 7 sticky notes that will guide you step-by-step.
- Airtable: Use the link in the main sticky note (
[1]) to duplicate the Airtable base to your own account. - Ollama: Make sure you have pulled the two required models listed above.
- Credentials: You will need to add three credentials in n8n:
- Your Google Drive (OAuth2) credentials.
- Your Airtable (Personal Access Token) credentials.
- Your Ollama credentials. (To do this, create an "OpenAI API" credential, set the Base URL to your local server (e.g.,
http://localhost:11434/v1), and useollamaas the API Key).
- Follow the Notes: Click through the workflow and follow the numbered sticky notes (
[1]to[6]) to connect your credentials and select your folders for each node.
How to customize the workflow
- Use Cloud AI: This template is flexible! You can easily swap the local Ollama models for a cloud provider (like OpenAI's GPT-4o or Anthropic's Claude 3). Just change the credentials and model name in the two AI nodes (
OpenAI Chat ModelandData Cleaner). - Add More Fields: To extract more data (e.g.,
SupplierVATNumber), simply add the new field to the prompt in theData Cleanernode and map it in theAirTable - Create a record1node.