Automated Invoice OCR and Financial Data Entry to Airtable - n8n Workflow

A robust n8n workflow for financial automation. Automatically extract invoice data using an OCR n8n node, clean it with AI, and sync structured data to Airtable. Ideal n8n templates for finance teams.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?

Finance departments looking to automate accounts payable data entry.
Technical users wanting to leverage local or self-hosted AI models (like Ollama) within an n8n workflow.
Accountants who need reliable, structured invoice data synced directly into Airtable.
n8n users seeking advanced file processing n8n templates.

Overview

Manual entry of invoice data is time-consuming and error-prone. This powerful n8n workflow eliminates that burden by creating a seamless, AI-driven pipeline. It starts with an efficient n8n trigger monitoring a Google Drive folder for new files. Once a file is detected, the n8n automation uses specialized OCR models to extract raw text and table data. The subsequent step uses a sophisticated cleaning AI (like Command-R) implemented via an n8n node to enforce strict JSON formatting and crucial numeric standardization (e.g., removing currency symbols and thousands separators). Finally, the structured data is securely logged into Airtable. This n8n workflow demonstrates how to build resilient automation, including pathways to move successful and failed files, ensuring your financial data pipeline is both fast and reliable.

How it Works

This comprehensive n8n workflow operates in several critical stages:


  1. Trigger and Initialization: The process begins with the OCR folder n8n trigger (Google Drive Trigger), which actively monitors a specific folder for newly uploaded invoice files. The Loop Over Items n8n node then ensures that if multiple files arrive simultaneously, they are processed sequentially.

  2. File Download and Tracking: The file name & ID Set n8n node captures essential metadata (File ID, Original Filename) needed for tracking and later file movement. The Download file n8n node fetches the document's binary data from Google Drive.

  3. OCR Extraction: The AI Agent-OCR n8n node utilizes the OpenAI Chat Model (configured for local models like Nanonets-OCR-s) to perform the high-accuracy Optical Character Recognition, returning structured text, HTML tables, and LaTeX equations.

  4. Data Cleaning and Structuring: The critical Data Cleaner n8n node, powered by another LLM (Command-R via an OpenAI n8n node), receives the raw OCR output. It executes a detailed system prompt to sanitize the data, ensure all monetary fields are strictly numeric, handle date conversions, and output a validated JSON object ready for Airtable.

  5. Airtable Logging: The AirTable - Create a record1 n8n node inserts the finalized, structured financial data into the designated Airtable base and table. Date formats are converted during this step using n8n expressions.

  6. File Cleanup: Upon successful Airtable logging, the file is moved by the Move successful n8n node to a 'done' folder. If any AI step fails (due to error pathways defined in the n8n workflow), the file is routed to the Move failed n8n node for review.

Installation Guide

To deploy this powerful n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and import it directly into your n8n instance using the 'New' -> 'Import from JSON' option.

  2. AI Model Setup (Ollama/Local AI): As noted in the sticky note, ensure your self-hosted AI environment (e.g., Ollama) is running and accessible to n8n. Pull the required models:

ollama pull benhaotang/Nanonets-OCR-s:F16 # For OCR
ollama pull command-r7b:7b-12-2024-q8_0 # For Cleaning

  1. Credential Setup: Configure the following credentials:

Google Drive OAuth2 API: Used by the Google Drive Trigger and file operation n8n nodes.
OpenAI API (or Ollama Endpoint): Used by the two AI n8n nodes (AI Agent-OCR and Data Cleaner). If using Ollama, your API base URL should point to your local endpoint (e.g., http://localhost:11434/v1).
* Airtable Personal Access Token: Used by the Airtable n8n node to write the data.

  1. Configure Google Drive Folders: Update the OCR folder n8n trigger to watch your desired input folder. Also, update the Move successful and Move failed n8n nodes to point to their respective clean-up folders.

  2. Activate: Save the n8n workflow and enable the Google Drive n8n trigger to start monitoring for new files.

Node Details

This n8n workflow utilizes several key n8n nodes to achieve its goal:

OCR folder (Google Drive Trigger n8n trigger):
Function: Initiates the n8n workflow whenever a new file is created in the designated 'finocr' Google Drive folder.
Key Configuration: Event set to fileCreated, Trigger On set to specificFolder.
Download file (Google Drive n8n node):
Function: Downloads the binary content of the newly created file, making it available for the downstream AI n8n node.
Key Configuration: Operation set to download, using the ID extracted from the initial n8n trigger data.
AI Agent-OCR (Langchain Agent n8n node):
Function: Orchestrates the initial extraction of text, tables, and structured elements from the document using the connected OCR model.
Key Configuration: Uses a specific prompt instructing extraction and formatting of tables in HTML and equations in LaTeX.
Data Cleaner (OpenAI n8n node):
Function: Takes the raw, unstructured OCR output and cleans it according to a strict financial schema, ensuring all numeric fields are standardized (no commas, no currency symbols). This is a vital step in this n8n automation.
Key Configuration: Model ID set to command-r7b:7b-12-2024-q8
0, JSON Output enabled, and a highly detailed system message defining the target JSON schema and cleaning rules.
AirTable - Create a record1 (Airtable n8n node):
Function: Creates a new record in the Airtable 'Invoices' table using the validated JSON output from the data cleaning n8n node.
Key Configuration: Mapping defines precise field assignments, including a date conversion expression (DateTime.fromFormat) for IssueDate. Typecast is enabled.
Move successful / Move failed (Google Drive n8n node):
* Function: Cleans up the input folder by moving the processed file to either a success or failure archive folder, maintaining the integrity of the n8n workflow’s input queue.

Related n8n Workflows

Free

Nodes: 10 Nodes
Updated: December 26 2025
View all
Created by

Hi! 👋 I'm Ehsan , a BI & Data Analyst and AI Specialist with a passion for automation! 🤖 I use n8n , Python , and SQL to build powerful data pipelines and turn complex data into real-world insights.

Featured*