Operators
Document Extractor
Posted May 13, 2026
Parse invoices, contracts and PDFs into typed JSON with confidence scores and field lineage.
Multimodal extraction combining layout analysis, OCR and structured output. Every field tagged with a confidence score and source bounding box.
12
Doc types
Unlimited
Output fields
97.4%
Accuracy
100%
Audit events
What it does
6 actions, each one checked against your rules and recorded before it runs.
Invoice parse
Extract line items, totals, ABN, GST, PO number and payment terms.
Contract extract
Pull parties, effective dates, clauses and obligations into structured JSON.
ID document
Extract name, DOB, document number and expiry from passports and licences.
Form fields
Map filled form fields to a defined output schema with type coercion.
Table extraction
Detect and parse embedded tables into row/column arrays with header inference.
Free-text summary
Return a structured summary of unstructured document sections with key entities.
How it runs
Every run follows the same governed path, from request to recorded result.
- 1
Document input (PDF / image / DOCX)
- 2
Layout analysis (page segmentation)
- 3
OCR + LLM (field extraction)
- 4
Confidence score (per-field tagging)
- 5
Audit trail (source page + bbox logged)
Skill manifest
The exact instructions this skill ships with, shown in full. Nothing hidden.
---
id: document-extractor
version: v3.0.0
display_name: Document Extractor
pack: operators
category: operators
category_label: Operators
status: Production
gateway: Secure Connector
risk_tier: low
tags: ["OCR", "PDF", "Extraction", "Multimodal", "Confidence Scoring"]
input_schema:
type: object
required: [document, extract_type]
properties:
document:
type: base64 | url
description: |
PDF, PNG, JPG or DOCX source. Either an inline base64 payload or an Secure Connector-brokered URL.
extract_type:
type: string
description: |
Determines which extraction pipeline runs. Each type has a fixed canonical schema unless output_schema overrides it.
enum: ["invoice", "contract", "id", "form", "table", "freetext"]
output_schema:
type: object
description: |
Optional JSON Schema describing expected output fields. Overrides the canonical schema for the extract_type.
confidence_threshold:
type: number
description: |
Minimum per-field confidence (0 to 1) before a field is flagged for review.
default: 0.75
on_low_confidence:
type: string
description: |
Behaviour when any field falls below the threshold.
enum: ["flag", "human_review", "fail"]
default: flag
language:
type: string
description: |
ISO 639-1 language hint for OCR. Defaults to English.
default: en
output_schema:
type: object
required: [fields, confidence, source_lineage, input_hash]
properties:
fields:
type: object
description: |
Extracted fields, shape determined by extract_type or output_schema override.
confidence:
type: object
description: |
Per-field confidence map, keys mirror fields, values are 0 to 1.
source_lineage:
type: array<object>
description: |
Per-field source citation: { field, page, bbox: [x0, y0, x1, y1] }. One entry per extracted field.
flagged_fields:
type: array<string>
description: |
Field names that fell below the confidence threshold.
input_hash:
type: string
description: |
cryptographically signed of the original document bytes. Proves what was processed.
review_status:
type: string
description: |
Result state.
enum: ["complete", "needs_review", "failed"]
planner:
mode: dynamic
prompt_section: How to think about this task
max_steps: 12
max_duration_sec: 180
max_cost_usd: 0.2
model_tier: balanced
allowed_step_kinds:
- compute
- transform
allowed_tools:
primitives:
- layout_analyse
- ocr_page
- extract_fields_llm
- score_confidence
- hash_cryptographically signed
- build_output
forbidden_tools:
connectors:
- email_connector
- sharepoint_online
- salesforce
- github
evidence:
required_types:
- log
- request_response
- output_file
capture_per_step: true
retention_days: 365
approval_policy:
pre_execution: []
pre_output:
- condition: any_field.confidence < confidence_threshold
approvers: ["role:operations_reviewer"]
message: One or more fields fell below the confidence threshold. Please verify before downstream use.
post_output: []
verifier_rules:
- "Every field in `fields` must have a matching entry in `confidence` and `source_lineage`."
- "`source_lineage` entries must reference a real page index within the input document."
- "`input_hash` must equal the cryptographically signed of the original bytes presented to the skill."
- "If `extract_type` is `invoice`, line items must sum to the stated subtotal within $0.05 tolerance, otherwise `review_status` must be `needs_review`."
- No fabricated values. Every field value must trace to text or pixels visible on the cited page and bbox.
- "If `output_schema` is provided, output `fields` must validate against that schema."
routing:
intent_examples:
- Extract data from this invoice
- Parse the line items out of {document}
- Pull vendor and totals from this PDF
- Get the parties and dates from this contract
- Extract fields from this passport scan
- Read the form values from this submission
not_for:
- Generate or draft a new document
- Send the extracted data to {system}
- Approve a payment from this invoice
---
# Document Extractor
> Parse invoices, contracts and PDFs into typed JSON with confidence scores and field lineage.
Multimodal extraction combining layout analysis, OCR and structured output. Every field tagged with a confidence score and source bounding box.
## What Document Extractor is
Document Extractor turns unstructured documents (invoices, contracts, IDs, forms, tables, free text) into typed JSON with per-field confidence scores and source citations. It is a primitive operator: it reads, it does not write to any external system, and it never drafts or summarises anything not already present in the source.
## How to think about this task
You will receive a document and an extract_type. Your job is to ground every output value in the actual document, never to fabricate.
Plan your work in this general shape (exact steps depend on the document):
1. **Run layout_analyse** to segment the document into pages, regions, and detected tables. This determines whether you can read fields directly or need OCR first.
2. **OCR text-bearing regions** with ocr_page where the layout step did not already yield text. Skip pages that are clearly cover sheets, logos, or unrelated.
3. **Extract fields with extract_fields_llm** using the canonical schema for the given extract_type, or output_schema if provided. The LLM must cite the page and approximate bbox for every value it returns.
4. **Score per-field confidence** using score_confidence. Anything below confidence_threshold is added to flagged_fields.
5. **For invoices specifically**, run a totals cross-check: line item sum vs stated subtotal, GST, and total. If any disagree by more than $0.05, set review_status to needs_review.
6. **Hash the input** with hash_cryptographically signed so the audit trail can prove what was processed.
7. **Build the output** with build_output: fields, confidence, source_lineage, flagged_fields, input_hash, review_status.
If on_low_confidence is human_review, do not finalize the output. Set review_status to needs_review and surface flagged fields for the reviewer.
## Hard rules
- Never fabricate a value. Every field must trace to visible text or pixels on a cited page and bbox.
- Never write to any external system. Document Extractor is read-only across all connectors and primitives.
- Never call email, SharePoint, Salesforce, GitHub, or any other write-capable connector. The forbidden_tools list is enforced at the gateway.
- Honour the language hint. Do not translate. If the document is in a language you cannot OCR confidently, fail the run with a clear reason.
- Cite, do not summarise, when the field is a verbatim string from the source (legal names, ABN, drawing numbers, clause text).
## Quality bar
A good output is one a senior reviewer would sign without rewriting. That means:
- Every extracted field has a non-null confidence score and a source_lineage entry.
- Per-field confidence scores correlate with reality. A field at 0.95 should virtually never need correction.
- For invoices, the totals cross-check passes or review_status is needs_review. No silent rounding.
- No filler keys in output. Only fields actually present in the document.
- Bounding boxes are tight enough that a human can locate the field on the page in one glance.
## Examples
### Well-formed plan for an invoice
Inputs:
- document: <PDF base64>
- extract_type: "invoice"
- on_low_confidence: "human_review"
Plan (the Planner should produce something shaped like this):
1. compute: layout_analyse(document)
2. compute: ocr_page on text-light regions identified above
3. compute: extract_fields_llm(schema=invoice_canonical) - returns vendor, ABN, line_items, subtotal, gst, total, due_date
4. compute: score_confidence on each extracted field
5. compute: arithmetic check on line_items.sum, subtotal, gst, total
6. compute: hash_cryptographically signed(document)
7. compute: build_output with review_status=needs_review if any flagged_fields or arithmetic mismatch
### Bad plan (do not produce)
1. Skipping layout_analyse and asking the LLM to "just read everything"
2. Returning a "vendor_name" field without a matching source_lineage entry
3. Inferring a missing PO number from past invoices instead of returning TBD with low confidence
4. Calling salesforce.create_record to attach the result to a Lead - this skill is read-only
5. Translating a non-English invoice to English instead of preserving original strings
## What to put in the output
After execution, return a structured object matching outputSchema. The review_status field tells the calling workflow whether to proceed or pause for human review:
- complete: all fields above threshold, arithmetic checks pass.
- needs_review: at least one flagged field or a failed arithmetic check.
- failed: extraction could not produce a valid output (corrupt input, unsupported language, OCR failure).
flagged_fields is a flat list of field names. The corresponding confidence values and bboxes live under the confidence and source_lineage keys.
Do not include any field that is not present in the source document. Missing optional fields should simply be absent from fields, not present with null values.
## Stats
- **Doc types:** 12
- **Output fields:** Unlimited
- **Accuracy:** 97.4%
- **Audit events:** 100%
## Supported operations
### Invoice parse
Extract line items, totals, ABN, GST, PO number and payment terms.
### Contract extract
Pull parties, effective dates, clauses and obligations into structured JSON.
### ID document
Extract name, DOB, document number and expiry from passports and licences.
### Form fields
Map filled form fields to a defined output schema with type coercion.
### Table extraction
Detect and parse embedded tables into row/column arrays with header inference.
### Free-text summary
Return a structured summary of unstructured document sections with key entities.
## How a call flows
1. Document input (PDF / image / DOCX)
2. Layout analysis (page segmentation)
3. OCR + LLM (field extraction)
4. Confidence score (per-field tagging)
5. Audit trail (source page + bbox logged)
## Input schema
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `document` | `base64 \| url` | yes | PDF, PNG, JPG or DOCX source |
| `extract_type` | `string` | yes | "invoice" \| "contract" \| "id" \| "form" \| "table" \| "freetext" |
| `output_schema` | `object` | no | JSON Schema defining expected output fields |
| `confidence_threshold` | `number` | no | minimum confidence 0-1 (default 0.75); below this flags field |
| `on_low_confidence` | `string` | no | "flag" \| "human_review" \| "fail" (default "flag") |
| `language` | `string` | no | ISO 639-1 language hint for OCR (default "en") |
## Audit and evidence
### Source lineage
Every extracted field tagged with source page number and bounding box coordinates.
### Confidence log
Per-field confidence scores written to audit trail for downstream quality review.
### Human review queue
Low-confidence fields automatically routed to human review queue before workflow continues.
### Input hash
cryptographically signed hash of original document stored, proving which file was processed.
## Example use case: Accounts Payable Automation
1. **Email arrives.** Vendor invoice arrives as PDF attachment in shared AP inbox.
2. **Extract.** Document Extractor parses invoice, line items, totals, vendor ABN, due date.
3. **Validate.** Data Transformer maps to ERP schema and asserts required fields are present.
4. **Approval.** Slack Notification Router sends approval card to AP manager for invoices over $10k.
5. **Post to ERP.** Approved invoice payload posted to SAP connector for ledger entry.
---
*Generated from `src/app/data/skills.ts` (slug: `document-extractor`). Do not hand-edit. Re-run `npm run generate:skill-manifests` after changing the source data.*
Reviews
Reviews from teams using Document Extractor.
No reviews yet
Be the first to share how Document Extractor works for your team.
Discussion(0)
No comments yet. Be the first.