Quick overview
This workflow lets you upload an invoice image via an n8n form, runs OCR and field extraction against a DGX Spark-hosted LiteLLM OpenAI-compatible endpoint (OCR model + Qwen3.6), and returns the parsed supplier, invoice number, date, total, and currency in a completion page.
How it works
- Presents an n8n form where a user uploads a single invoice page image (PNG/JPG).
- Converts the uploaded file to a base64 string to embed it into an API request.
- Sends the image to the DGX Spark LiteLLM chat completions endpoint using an OCR model to produce invoice text.
- Sends the OCR text back to the same endpoint using the Qwen3.6 model to extract supplier name, invoice number, invoice date, total amount, and currency as JSON.
- Parses the returned JSON and displays the extracted fields in an n8n form completion screen.
Setup
- Configure an OpenAI API credential in n8n that points to your DGX Spark LiteLLM server (base URL like http://<spark-ip>:4000) and select it in both HTTP Request steps.
- Replace <spark-ip> in the two request URLs with your DGX Spark host/IP (and ensure the /v1/chat/completions endpoint is reachable from n8n).
- Verify the LiteLLM server exposes the models used by this workflow (model names ocr and qwen3.6) and adjust them if your deployment uses different identifiers.
- Run the workflow once to get the form URL, then open it to upload an invoice image and test the extraction output.