Extract Data from Thai Government Letters with Mistral OCR and Store in Google Sheets — n8n Workflow

High complexity🔗 Webhook16 nodes👩‍💻 IT Opsby Jaruphat J.

Overview

LINE OCR Workflow to Extract and Save Thai Government Letters to Google Sheets

This template automates the extraction of structured data from Thai government letters received via LINE or uploaded to Google Drive. It uses Mistral AI for OCR and OpenAI for information extraction, saving results to a Google Sheet.

Who’s it for?

Thai government agencies or teams receiving official documents via LINE or Google Drive Automation developers working with document intake and OCR Anyone needing to extra

Nodes used

Google SheetsHTTP RequestGoogle DriveOpenAI Chat ModelInformation ExtractorMistral AI

Workflow Preview

LINE Bot Letter OCR Workflow
Features:
- Receive files from LINE and Google Drive
- OCR using Mistral Document AI
- Extract invoice information using OpenAI's Informatio
- Automatic
LINE Webhook
Receive data from LINE:
- Accepts POST request from LINE Messaging API
- Extracts `messageId` for downloading file
Path: `/line-invoice`
Method: `POST`
Download File from LINE
Process:
1. Check if message type is "image"
2. Use `messageId` to download the file
3. Set metadata fields: source, fileName, fileId
4. Store `fileBinary` for OCR
Google Drive Trigger
Monitor for new files:
- Watch a specific folder in Google Drive
- Trigger the workflow when a new file is added
- Supports PDF, JPG, JPEG formats
Folder ID: `$env.
Merge Data Sources
Combine data from both sources:
- LINE: source = "line", fileName, fileId, fileBinary
- Drive: source = "drive", fileName, fileId, fileBinary
Output: Unified data obje
File Type Check
Determine file type:
- JPG, JPEG → OCR Image Processing
- PDF → OCR Document Processing
Regex Pattern: `.*\.(jpg|jpeg|png)$`
True: Continue to OCR via Mistral
Mistral OCR Image
OCR using AI:
Steps:
1. Encode image file to Base64
2. Send to Mistral OCR node
3. Receive parsed text from the image
Mistral OCR Document
OCR using AI:
Steps:
1. Encode PDF file to Base64
2. Send to Mistral OCR node
3. Receive parsed text from the document
AI Validation Agent
Extract and validate data using AI:
Validation fields:
- book_id
- subject
- to
Google Sheets Output
Append structured data to Google Sheets:
Columns:
- book_id
- subject
- to
LINE Reply
Send reply message to LINE user:
- Confirm invoice has been saved
- Include extracted details
File Source Handling
Differentiate by file origin:
- LINE → Reply with summary
- Google Drive → Move file to archive folder
Google Drive Move Folder
Organize processed files:
- Move to archive/storage folder
model
L
LINE Webhook
Get Line File
S
Set Line Data
G
Google Drive Trigger
Download File (Drive)
M
Merge Data Sources
C
Check File Type
Write to Google Sheet
Reply to LINE
C
Check Source for Reply
Information Extractor
OpenAI Chat Model
S
Set Drive Data
Move file
Extract text IMG
Extract text PDF
16 nodes16 edges

How it Works

  1. 1

    Trigger

    The workflow starts with a webhook trigger.

  2. 2

    Process

    Data flows through 16 nodes, connecting googledrive, googledrivetrigger, googlesheets.

  3. 3

    Output

    The workflow completes its automation and delivers the result to the configured destination.

Node Details (16)

GO

Google Sheets

googleSheets

#1
HT

HTTP Request

httpRequest

#2
GO

Google Drive

googleDrive

#3
OP

OpenAI Chat Model

n8n-nodes-langchain.lmChatOpenAi

#4
IN

Information Extractor

n8n-nodes-langchain.informationExtractor

#5
MI

Mistral AI

mistralAi

#6

How to Import This Workflow

  1. 1Click Download JSON button on the right to save the workflow file.
  2. 2Open your n8n instance. Go to Workflows → New → Import from file.
  3. 3Select the downloaded extract-data-from-thai-government-letters-with-mistral-ocr-and-store-in-google-sheets file and click Import.
  4. 4Set up credentials for each service node (API keys, OAuth, etc.).
  5. 5Click Test Workflow to verify everything works, then activate it.

Or paste directly in n8n → Import from JSON:

{ "name": "Extract Data from Thai Government Letters with Mistral OCR and Store in Google Sheets", "nodes": [...], ...}

Integrations

googledrivegoogledrivetriggergooglesheetshttprequestifinformationextractorlmchatopenaimergemistralaisetwebhook

Get This Workflow

Download and import in one click

Download JSONView on n8n.io
Nodes16
Complexityhigh
Triggerwebhook
CategoryIT Ops

Created by

Jaruphat J.

Jaruphat J.

@jaruphatj

Tags

googledrivegoogledrivetriggergooglesheetshttprequestifinformationextractorlmchatopenaimergemistralaiset

New to n8n?

n8n is a free, open-source workflow automation tool. Self-host it or use the cloud version.

Get n8n Free →

Related IT Ops Workflows

GMGOIFOP+2
medium

AI Third-Party Risk Assessment & Vendor Onboarding in n8n

Manual vendor risk assessments are a bottleneck for modern compliance teams. This automated workflow streamlines the entire Third-Party Risk Management (TPRM) lifecycle by integrating AI intelligence with your existing tech stack. The process triggers via a Webhook (such as a form submission), where OpenAI analyzes vendor documentation, data access levels, and security certifications to determine an objective risk tier. By applying logic-based filtering, the flow automatically categorizes vendors into Low, Standard, or Critical risk profiles. It then logs all due diligence data into Google Sheets for a permanent audit trail and sends personalized status notifications via Gmail to procurement stakeholders. This eliminates manual data entry and ensures that every vendor undergoes the same rigorous scrutiny. Whether you are preparing for a SOC2 audit or managing a growing supply chain, this automation provides a scalable, traceable, and AI-enhanced framework for governance, risk, and compliance (GRC) without the overhead of expensive enterprise software. **Common Use Cases:** - Automated SOC2/ISO 27001 evidence gathering for vendor audits - High-speed security screening for SaaS procurement requests - Continuous supply chain monitoring and risk tiering database

🔗 Webhook·6 nodes
GMGOOPSW+1
medium

AI Lead Nurturing & Routing for FinTech (n8n & OpenAI)

Transform your financial services firm into a high-conversion machine with this automated lead management framework. This n8n workflow eliminates the friction of manual data entry and generic follow-ups by leveraging OpenAI to generate hyper-personalized email responses based on specific prospect intent. Whether you are managing credit repair inquiries or insurance applications, the system acts as an intelligent virtual assistant that categorizes incoming webhooks in real-time. The process begins when a lead is captured via your frontend (such as Lovable or a custom landing page). The workflow utilizes an advanced Switch logic to segment prospects into specialized funnels—Business Funding, Life Insurance, or Recruitment. OpenAI then analyzes the lead's unique profile to draft a context-aware email that addresses their specific pain points, which is automatically dispatched via Gmail. Simultaneously, all lead data and AI-generated insights are logged into Google Sheets, providing your sales team with a centralized, up-to-date CRM. This automation ensures a zero-latency response time, significantly increasing your chances of conversion while freeing your team from repetitive administrative tasks. **Common Use Cases:** - Automated qualification and personalized outreach for commercial loan applicants. - Dynamic recruitment funnels for scaling independent insurance agencies. - High-touch lead nurturing for credit restoration and financial consulting services.

🔗 Webhook·14 nodes
@ACOGOGO+4
medium

Automate Amazon Review Sentiment Analysis with Gemini AI

Transform raw customer feedback into actionable product intelligence with this advanced n8n automation. This workflow eliminates the manual drudgery of sorting through thousands of Amazon reviews by leveraging the Apify scraper to extract high-intent data. Once retrieved, the data is processed through Google Gemini AI, which performs deep sentiment analysis to pinpoint recurring pain points and product defects. Unlike basic scrapers, this system categorizes negative feedback into root causes and generates strategic improvement suggestions to help brands regain their competitive edge. The final insights are systematically logged into Google Sheets and pushed to Slack, ensuring your product development and customer success teams receive real-time alerts on critical issues. By automating this loop, businesses can drastically reduce response times to market trends and improve their Amazon Best Seller Rank (BSR) through data-driven product iterations. This is an essential tool for e-commerce managers and private label sellers looking to operationalize consumer insights without manual data entry. **Common Use Cases:** - Automated Product R&D for Private Label Sellers - Competitor Vulnerability Mapping and Market Research - Customer Experience Monitoring and Slack Alert System

Trigger·8 nodes
medium

AI-Driven School Allergy Safety & Menu Auditing via n8n

This advanced n8n workflow revolutionizes student safety by automating the critical task of dietary cross-referencing. By integrating Google Sheets with AI-powered analysis, the system eliminates human error in high-stakes cafeteria environments. The workflow functions as a proactive safety net: it ingests daily menu data and cross-references it against a centralized database of student allergy profiles and classroom rosters. Using LLM logic, it identifies hidden ingredients or cross-contamination risks that standard keyword searches might miss. When a conflict is detected—such as a gluten-sensitive student being scheduled for a meal containing wheat—the system triggers an instant Slack notification to nutritionists and teachers. Beyond immediate alerts, the flow generates AI-suggested menu alternatives to ensure every student has a safe, nutritious meal option. This automation not only ensures strict compliance with health regulations but also saves administrative staff hours of manual spreadsheet auditing, allowing them to focus on meal quality rather than data entry. **Common Use Cases:** - Real-time dietary conflict alerting for school cafeterias - Automated ingredient cross-referencing for institutional catering - AI-powered meal substitution planning for healthcare facilities

▶️ Manual·6 nodes
FUGOIFME+2
medium

Automate Inventory Tracking: Google Sheets & Slack (n8n)

Stop manual stock monitoring and prevent lost revenue with this automated Order Management System (OMS) template. This high-efficiency n8n workflow bridges the gap between your sales channels and warehouse operations. When a new order triggers the API webhook, the system instantly cross-references SKU data against your Google Sheets master inventory. By utilizing advanced logic and merge nodes, the workflow calculates availability in real-time. If stock levels are sufficient, it updates your records; if a shortage is detected, it sends an immediate, actionable alert to your team via Slack. This automation is designed for growing e-commerce businesses that need to eliminate human error in fulfillment. Instead of reactive firefighting when items sell out, your operations team can proactively manage supply chains. The flow handles complex data parsing through custom function nodes, ensuring that even multi-item orders are processed with precision, ultimately reducing operational overhead and improving the customer experience by preventing backorder frustrations. **Common Use Cases:** - E-commerce fulfillment automation for Shopify or WooCommerce stores using Google Sheets as a lightweight ERP. - Real-time low-stock alerting for high-volume hardware or electronics distributors to prevent supply chain bottlenecks. - Automated internal requisition tracking for large corporate offices managing hardware assets and office supplies.

🔗 Webhook·13 nodes
COGOMAME+5
high

Automate GitHub Talent Sourcing to Google Sheets via n8n

Stop manual profile hunting and transform your technical recruitment with this high-performance n8n automation. This workflow leverages BrowserAct to perform deep-tissue scraping of GitHub user profiles, extracting mission-critical data points—including repository history, tech stacks, and recent coding activity—directly into structured Google Sheets reports. By automating the data enrichment phase, technical recruiters and HR teams can bypass hours of manual copy-pasting, ensuring a real-time database of pre-qualified developer talent. The flow operates by triggering a batch process that iterates through a list of GitHub handles, utilizing BrowserAct’s stealth scraping capabilities to bypass complex web barriers. Once the data is captured, a custom Code node cleans and formats the JSON output before merging it into a multi-tab Google Sheet for granular reporting. Finally, the workflow sends a summary notification via Slack to alert your team of new candidate insights. This is an essential blueprint for data-driven talent acquisition and competitive business intelligence, providing a seamless bridge between raw GitHub data and actionable recruitment pipelines. **Common Use Cases:** - Automated Technical Talent Mapping for Recruitment Agencies - Developer Outreach Enrichment for Open Source Project Growth - Competitive Intelligence and Tech Stack Analysis for BI Teams

Trigger·19 nodes