Use this robust n8n workflow to automatically scan, process, and extract structured financial data from Japanese invoices (PDFs/Images) using OCR.Space and GPT-4o-mini, logging results directly into Google Sheets.
Download this n8n workflow template and start using it instantly.
Handling invoices often involves repetitive and error-prone manual data entry. This advanced n8n automation template solves this by providing a hands-off, scheduled solution for invoice processing. The core problem addressed is translating unstructured image or PDF invoice data into clean, structured data for accounting purposes.
This n8n workflow leverages the power of cloud services and AI: Google Drive acts as the input source; OCR.Space extracts raw text from the documents; and finally, the OpenAI n8n node (GPT-4o-mini) enforces a strict JSON schema to extract critical fields like dates, totals, client names, and bank information. The extracted data is then securely and neatly recorded in a target Google Sheet, making this an essential automation for modern back-office operations. This powerful n8n workflow significantly boosts accuracy and efficiency.
The entire process starts with a recurring Schedule n8n trigger:
jpn) and table extraction, converting the image content into raw text.OCR (OCR.Space Parsing) HTTP Request n8n node by replacing ocrapikey> in the header parameters with your actual key.googlesheetid> with the ID of your target accounting ledger sheet. Schedule Trigger (Weekly Scan):
Function: Acts as the starting n8n trigger, initiating the entire data extraction process automatically every week.
Key Configuration: Set to run weekly (in the provided JSON, Monday at 20:00).
Google Drive Nodes (Get Parent Folder, Get Monthly Subfolder, List Files, Download File):
Function: Manages file access, dynamically locating the current month's invoice subfolder, listing relevant PDFs/images, and downloading them as binary files.
Key Configuration: Uses advanced query strings to filter by file type and folder name, using the current date ($now) for month detection.
OCR (OCR.Space Parsing) (HTTP Request n8n node):
Function: Sends the binary invoice file to the external OCR.Space API to perform Optical Character Recognition.
Key Configuration: Uses multipart-form-data to send the binary file; specifies language: jpn (Japanese) and includes the API key in a custom header.
Clean OCR Text (Noise Removal) (Code n8n node):
Function: Pre-processes the raw text output from OCR, crucial for high-quality LLM input. It standardizes line breaks, spaces, and currency symbols.
Key Configuration: Contains custom JavaScript for text normalization using RegEx.
AI Extraction (Generate Structured JSON) (OpenAI n8n node):
Function: Utilizes GPT-4o-mini to analyze the cleaned invoice text and extract specific data points into a standardized JSON structure.
Key Configuration: Uses a detailed system prompt for schema enforcement (e.g., extracting total, invoicedate, bankinfo), ensuring the output is always valid JSON.
Parse AI Output to JSON (Code n8n node):
Function: Safely converts the AI's textual JSON output string back into a usable data object within the n8n workflow.
Append to Google Sheets (Google Sheets n8n node):
Function: The final action, which writes the structured data extracted by the AI into the designated row in the Google Sheet ledger.
Key Configuration: Dynamically sets the Sheet Name based on the discovered monthly folder and maps all extracted invoice fields (like total, tax, dates, and PDF link) to specific column headers. This completes the essential step of this automated 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.

Use this powerful n8n workflow to automate invoice generation and client email delivery instantly upon project status update in Google Sheets. Leveraging the Google Sheets n8n trigger and specialized n8n node setup.

Use this advanced n8n workflow to automate invoice creation via Jotform and manage intelligent payment reminders using QuickBooks and Outlook, featuring AI-powered daily summary reports.

Automate your billing cycle instantly. This advanced n8n workflow uses a Jotform webhook trigger to check Xero contacts, create professional invoices, leverage GPT-4o-mini for email content drafting, and notify your team via Slack. Get the n8n templates here.

Streamline procurement and inventory with this powerful n8n workflow. Automatically process email invoices using AI, check Google Sheets stock, and notify Slack or Gmail.









































