← AI Workflow Templates
ExtractionadvancedHITL requiredupdated 2026-08-11
Structured Data Extraction
Extract a validated JSON object from messy text (invoices, resumes, forms) with a schema and a bounded repair loop.
#extraction#json#schema#validation
Tools in the pipeline
- llmextract-modelEmit JSON matching the schema.
- validatorvalidatorParse against Zod / JSON Schema.
- llmrepairAt most two retries with validator errors.
- humanreviewerHandle needs_review fields after retries fail.
Stack: LLM · Zod / JSON Schema
What it does
Pulls structured fields out of unstructured documents and guarantees the output matches a schema. The model emits JSON; a validator checks it; on failure the errors are fed back for a bounded repair attempt.
Pipeline
- Define — a strict schema (types, required fields, enums).
- Extract — prompt the model to emit JSON matching the schema.
- Validate — parse against the schema (e.g. Zod / JSON Schema).
- Repair — on validation error, return the errors to the model for up to 2 retries.
- Escalate — after retries fail, flag for human review with the raw output attached.
Guardrails
Never accept unvalidated output downstream. Cap repair retries to avoid loops and cost blowups. For low-confidence fields (e.g. a total that doesn't reconcile), mark them needs_review rather than passing a bad value through.
Structural dry-run
No model call. Validates required fields only.Prefills the example payload for Invoice. Edit it, then run.