Skip to product information

n8n Invoice Text to JSON Extractor (OpenAI Chat Completions)

n8n Invoice Text to JSON Extractor (OpenAI Chat Completions)

 (200+Reviews)
Regular price £57.99
Regular price £57.99 Sale price
SAVE Sold out
Instant Digital Download
Unlimited Downloads
Lifetime Access in Your Account
🔥
128+ Sold
Popular with n8n builders
23 people viewing
High interest right now
9 added today
Fast-moving digital product
n8n Invoice Text to JSON Extractor (OpenAI Chat Completions)

n8n Invoice Text to JSON Extractor (OpenAI Chat Completions)

Regular price £57.99
Regular price £57.99 Sale price
SAVE Sold out

Turn messy invoice text into clean JSON with OpenAI (with error routing)

Paste an invoice’s raw text into this n8n workflow and use OpenAI Chat Completions to extract normalized, schema-based invoice fields as clean JSON—while automatically routing any parse or extraction failures to a separate error output.

What this workflow does

  • Runs manually (start when you click “Run workflow”).
  • Loads the invoice body as plain text.
  • Builds a strict extraction prompt (including the model to use) and sends the prompt + invoice text to the OpenAI Chat Completions API.
  • Parses and cleans the response into valid JSON, including stripping any code fences returned by the model.
  • Validates extraction quality, ensuring meaningful invoice fields were captured and normalizing line items into an array.
  • Routes results: successful extractions go to the success output; failures include diagnostic details on the error output.

Use cases

  • Extract invoice totals, dates, parties, and line items from emails or PDFs that you’ve already converted to text.
  • Feed structured invoice JSON into downstream automations (ERPs, CRMs, or internal approval tools) without hand-parsing.
  • Build resilient invoice processing by separating “works” vs. “needs review” cases using the workflow’s error output.
  • Customize the extraction schema to match your own invoice format and data requirements.

Technical details

  • n8n: requires n8n 1.0 or later (self-hosted or Cloud).
  • OpenAI: use an OpenAI API key added as an HTTP Header Auth credential for the OpenAI request.
  • Nodes used: if, set, code, no op, sticky note, and an HTTP Request node for Chat Completions.
  • Customization: the extraction schema is defined as plain text in the “Set Extraction Prompt” node—edit fields, rules, or output shape before running.

With automated extraction and failure diagnostics, this n8n invoice text to JSON workflow helps you move from unstructured invoice text to reliable, schema-driven data.

View full details