Use this powerful n8n workflow to automate extraction of complex Thai documents using Typhoon OCR and Llama 3.1, structuring the data and saving it directly via an n8n node to Google Sheets. Find more sophisticated n8n templates here.
Download this n8n workflow template and start using it instantly.
Data entry specialists dealing with high volumes of Thai government or official documents.
Organizations needing to digitize and structure large archives of non-English language paperwork.
Developers looking for advanced n8n templates integrating command-line tools (OCR) with specialized large language models (LLMs).
Users of self-hosted n8n requiring robust, multi-step data processing pipelines.
Processing documents in complex languages like Thai often requires specialized optical character recognition (OCR) and high-quality large language models (LLMs) to accurately extract and structure the data. This robust n8n workflow provides a comprehensive, automated solution.
It solves the challenge of turning unstructured PDF text into clean, structured data ready for analysis. By leveraging the power of Typhoon OCR for precise Thai text extraction and connecting it with a specialized Llama 3.1 model (via the OpenRouter n8n node) for JSON formatting, this n8n template drastically reduces manual data entry time. The final step ensures all data is cleanly organized in a Google Sheet using the dedicated Google Sheets n8n node, making this an essential tool for automated data pipeline management within the n8n environment.
This n8n workflow operates sequentially, transforming local PDF files into spreadsheet rows:
doc/ folder.typhoonocr library to perform high-accuracy Thai OCR, outputting the raw text to standard output.bookid, subject, detail), instructing the LLM to format the entire text into a predictable JSON structure.scb10x/llama3.1-typhoon2-70b-instruct model, accessed securely via the 'OpenRouter Chat Model' n8n node.json), validates the JSON structure, and flattens any complex objects (like nested contact details) into distinct columns.To utilize this document processing n8n template, follow these steps:
executeCommand n8n node for OCR, you must ensure your n8n host machine has Python and the typhoon-ocr library installed and accessible. This specific integration requires a self-hosted setup. in the Python command with your actual Typhoon OCR API key.doc/ relative to your n8n execution environment before activating and running the n8n workflow. When clicking ‘Test workflow’ (Manual Trigger): The standard starting point for testing this n8n workflow. This n8n trigger manually initiates the data pipeline.
Load PDFs from doc Folder (Read/Write File n8n node): Scans the local doc/ directory to retrieve all files. Outputs a list of file objects, each containing the file name and path.
Extract Text with Typhoon OCR (Execute Command n8n node): Executes a custom Python script using the file path input (doc/{{$json["fileName"]}}). This powerful n8n node runs the OCR process outside of standard n8n nodes, leveraging specialized tools for Thai text recognition. Requires a locally installed Python environment.
Structure Text to JSON with LLM (Chain LLM n8n node): Directs the raw OCR text to the LLM backend (OpenRouter) with a specific, instruction-based prompt written in Thai, forcing the model to output a standardized JSON structure with 10 defined fields.
OpenRouter Chat Model (LLM n8n node): Acts as the execution engine for the Chain LLM, using the high-performance scb10x/llama3.1-typhoon2-70b-instruct model, which is optimized for complex Asian languages.
Parse JSON to Sheet Format (Code n8n node): Performs essential data manipulation. It cleans LLM artifacts, uses JSON.parse() to transform the structured text into a JavaScript object, and flattens nested contact details into separate spreadsheet columns, preparing the data perfectly for the next n8n node.
append operation and defining 12 column mappings based on the cleaned JSON output.Use this powerful n8n workflow to automatically extract detailed invoice information using DocSumo, structure the line items, and export the comprehensive results directly to a downloadable Excel file. This n8n automation template saves hours of manual data entry.

Use this powerful n8n workflow to extract and structure job posts from Hacker News 'Who is Hiring' threads, utilizing the Gemini AI n8n node for data structuring and persistence into Airtable.

Automate crawling YouTube video comments using the n8n platform. This powerful n8n workflow extracts comments, likes, and authors, storing them instantly in Google Sheets.

Automate X comment extraction using this powerful n8n workflow. Scrape author details, profiles, and comment text into structured JSON via the Airtop n8n node.

Use this powerful n8n workflow to automatically extract TikTok transcripts, translate or summarize them using OpenAI GPT-4, and save the final results directly to Google Docs. Get started with n8n templates today.

Project Manager who passionate about Automation & AI and continuously explore innovative ways to improve business processes through intelligent workflow automation. Let’s connect and automate the future!







































