Extract structured invoice data from text with OpenAI
Ready for 3.0What this workflow does
This workflow has 8 nodes and runs manually, when you click “Execute workflow”. It uses only n8n's built-in nodes. It also calls api.openai.com over HTTP.
How it runs
Trigger: Manually, when you click “Execute workflow”.
- Set Invoice Text (Edit Fields (Set)): sets 1 field: invoice_text
- Set Extraction Prompt (Edit Fields (Set)): sets 2 fields: extraction_prompt, model
- Extract Invoice Data (OpenAI) (HTTP Request): calls api.openai.com (POST)
- Parse AI Response (Code): runs custom JavaScript code
- Route Error or Success (If): checks a condition and branches into true / false
HTTP calls to: api.openai.com
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)
- Manual Trigger
n8n-nodes-base.manualTrigger - Edit Fields (Set)
n8n-nodes-base.set - HTTP Request
n8n-nodes-base.httpRequest - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - No Operation, do nothing
n8n-nodes-base.noOp
From the author
Quick overview This workflow lets you paste invoice text and uses OpenAI Chat Completions to extract normalized, schema-based invoice fields as clean JSON, routing parse or extraction failures to a separate error output. How it works 1. Starts when you run…