Orchestrating n8n & LLM pipelines for unstructured email parsing into production-ready JSON
Turning manual email-to-ERP transcription into a validated, autonomous n8n + LLM pipeline.
- 0
- malformed records to ERP
- Auto
- validated data stream
- Hours
- reclaimed weekly
Problem
Back-office staff transcribed inbound order emails into the ERP by hand. It was slow, easy to get wrong, and impossible to scale as volume grew.
Approach
We orchestrated an n8n pipeline where a large language model extracts structure from each email and a strict JSON schema validates every record, with automatic retries, before it can move. Anything that still fails is routed to human review; only clean, correctly typed data reaches the ERP, so a bad parse can never silently land in production.
The architecture
n8n is the orchestrator: it watches the inbox, hands each message to a large language model for extraction, then passes the model's output through a strict JSON schema before anything is trusted. The schema is the contract; the model proposes, the schema decides. This separation matters because an LLM is excellent at reading messy human text and unreliable as a source of truth on its own.
Making it production-safe
Every step is engineered for failure, not just the happy path. Extraction is checked against the schema; transient failures retry automatically with backoff; operations are idempotent so a replayed message never creates a duplicate order; and anything that still fails validation is routed to a human review queue rather than guessed. Observability over the pipeline means a stuck or failing run is caught in minutes, not at month-end.
The result
A manual, error-prone transcription task became an autonomous, validated data stream. Staff hours moved from copy-paste to exception handling, no malformed record reaches the ERP, and the same pattern now extends to other inbound document types without re-engineering the core.
Techniques
Have a system like this?
An experienced engineer, not a salesperson, will scope it with you and reply within 24 hours.
Start a project