Extract structured invoice JSON from PDFs with Mistral OCR and an LLM API
Ready for 3.0What this workflow does
This workflow has 8 nodes and runs when an HTTP POST request hits its webhook URL. It uses only n8n's built-in nodes. It also calls api.mistral.ai over HTTP.
How it runs
Trigger: When an HTTP POST request hits its webhook URL.
- Mistral OCR (Mistral AI): uses Mistral AI
- Normalize OCR Text (Code): runs custom JavaScript code
- LLM Extract JSON (HTTP Request): calls api.mistral.ai (POST)
- Clean JSON (Code): runs custom JavaScript code
- Confidence >= 0.5? (If): checks a condition and branches into true / false
- Respond OK (Respond to Webhook): sends the response back to the webhook caller
- Respond Review (Respond to Webhook): sends the response back to the webhook caller
HTTP calls to: api.mistral.ai
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Webhook
n8n-nodes-base.webhook - Mistral AI
n8n-nodes-base.mistralAi - Code
n8n-nodes-base.code - HTTP Request
n8n-nodes-base.httpRequest - If
n8n-nodes-base.if - Respond to Webhook
n8n-nodes-base.respondToWebhook
From the author
N8N AI LLM Unstructured Invoice data PDF OCR recognition to JSON output API What this workflow does 1. Accepts a PDF or image upload via Webhook as binary property "data" 2. Runs OCR with the Mistral OCR node 3. Normalizes OCR text 4. Sends OCR text to an LLM…