Skip to content
← All templates

Runnable workflow template

Document Extraction With Provenance

Extract structured fields while retaining page references, source text, confidence, parser version, and approval evidence.

Workflow sequence

  1. 01Hash and store source
  2. 02Extract typed fields
  3. 03Attach page and source references
  4. 04Run deterministic validation
  5. 05Route uncertain fields to review
  6. 06Publish approved record

Sequence definition

Use this definition as a starting point. Replace handlers with your HTTP workers, validate provider responses, and add credentials through the credential store rather than embedding secrets.

{
  "id": "document_extraction_provenance_v1",
  "blocks": [
    { "id": "archive", "type": "step", "handler": "archive_source" },
    { "id": "extract", "type": "step", "handler": "extract_with_citations" },
    { "id": "validate", "type": "step", "handler": "validate_document_fields" },
    { "id": "review_gate", "type": "router", "routes": [{ "condition": "steps.validate.output.needs_review == true", "blocks": [{ "id": "review", "type": "human_review", "timeout": "P2D" }] }] },
    { "id": "publish", "type": "step", "handler": "publish_approved_record", "idempotency_key": "{{steps.archive.output.sha256}}" }
  ]
}

Production controls to keep

Stable idempotency keys around external writes

Explicit validation before the success state

Bounded retries with provider-aware backoff

Searchable source and destination identifiers

A named owner for exhausted retries

A replay test using duplicate input

Run this workflow

Install Orch8, connect the handlers, then test duplicate delivery and worker interruption before production.

Open the quickstart