Inspectors
What is an Inspector?
An Inspector is a compliance checklist for a set of related documents. You list the documents you expect, each one extracted by a flow, and build a checklist of checks over their values. Every inspection ends in a verdict: same inputs, same verdict, every time.
A typical example is an import shipment: a commercial invoice, a packing list and a bill of lading. The Inspector checks that the totals agree, that the invoice number matches across documents, that the dates are in order and that nothing has expired. The rules are evaluated by a deterministic engine, not by an AI reading the documents, so the verdict is reproducible and every result can be traced back to the values that produced it.
Inspectors are in beta. They are available to every organisation, and the way they work may still change.
When to use an Inspector
- Cross-document checks before paying or releasing something: invoice against purchase order and delivery note
- Import and export file reviews: the same references, quantities and totals across every document
- Expiry and date rules: certificates still valid today, documents issued in the current month
- Format checks on single values: tax IDs, invoice numbers, allowed currencies
If what you need is a line-by-line price comparison across several versions of the same document, such as supplier quotes, use a Matcher instead.
Creating an Inspector
- 1Go to Inspectors and click New inspector. Give it a name (at least 3 characters) and an optional description, then click Create. To start from an existing inspector, use From template instead.
- 2In Expected documents, click Add document for each document the process needs: a Document name and the Extraction flow that reads it.
- 3Build the Checklist with Add check, Add branch or Suggest checks.
- 4Test it in the Dry run panel, then click Save in the header.
- 5Make sure the inspector is Active (the switch in the header). Inactive inspectors can't start new inspections.
Each expected document has these options:
| Option | What it does |
|---|---|
| Required / Optional | Required documents must arrive before the checklist runs. When an optional document is absent, the checks that read it are skipped, never failed. |
| Extraction flow | The flow that extracts the document. Its fields become available to the checklist. It must be an active flow. |
| Routing hint | What the document looks like. Helps the AI put uploaded files into the right slot. |
| Accept multiple documents | Lets several files fill the same slot, for example several delivery notes. |
If a document's flow has a Cleaner linked, the checklist reads the Cleaner's output columns, not the raw extracted fields. That is how you check a normalised date, a converted amount or a looked-up value.
Checks
A check reads values the document flows extract and passes or fails deterministically. Checks run top to bottom; drag them to reorder, and the report follows the same order.
| Part of a check | What it does |
|---|---|
| Check name | Shown in the report, for example “Totals reconcile with the packing list”. |
| Check that | One or more conditions. Use Add condition and Add group to combine them with AND / OR. |
| Severity | Blocker, Warning or Info. A failing blocker fails the whole inspection; warnings downgrade it to “pass with warnings”; info never affects the verdict. |
| Only run this check when… | An optional guard. When the guard doesn't hold (or reads an absent optional document) the check is skipped, never failed. |
| If this check fails | Actions: Request review (pick reviewers), Send email (recipients, comma separated) or Call webhook. |
Branches
A branch splits the checklist on a condition. Its When condition decides which lane runs: Then check when it holds, Otherwise when it doesn't. If the condition can't be evaluated (absent document, bad value), the Otherwise lane runs. Each lane can hold checks and further branches, and the branch name appears in the report. Checks in the lane that didn't run are reported as skipped.
A blocker that reads an optional document is skipped when the document is missing, so it can never fail the inspection. The builder flags it; consider Warning severity or making the document required.
Conditions and operators
Each condition picks a Document and a Field, an operator and a value. For a repeating (table) column, the first value is compared. Date fields can compare only one element of the date: Full date, Date only, Month + year or Year.
| Field type | Operators |
|---|---|
| Number | Equals, Not equals, Greater than, Less than, Greater or equal, Less or equal, Is one of, Is not one of, Is empty, Is not empty |
| Date | Equals, After, On or after, Before, On or before, Within range, Is empty, Is not empty |
| Text | Equals, Not equals, Contains, Does not contain, Starts with, Ends with, Matches pattern, Does not match pattern, Is one of, Is not one of, Is empty, Is not empty, plus the date operators and, in checks, AI match and AI check |
The value can be one of four kinds, chosen with the toggle next to it:
| Value | Use it for |
|---|---|
Literal value (# / Abc) | A fixed value, such as 0, USD or 2026-12-31. Dates are written YYYY-MM-DD (YYYY-MM or YYYY when comparing a month or a year). |
Another document's field (f(x)) | Cross-document checks, such as the invoice total equals the purchase order total. Numeric Equals / Not equals accept a tolerance in %, measured against the right-hand value. |
Percentage of another document's field (%) | Numbers only, such as the freight is less than 10% of the invoice total. |
| Dynamic date | Today, Current month or Current year, resolved in your organisation's timezone when the inspection runs. A full date against Current month compares by month and year. |
- Numbers ignore thousands separators, spaces and currency symbols. Text is trimmed and compared without regard to case.
- Two values that both read as dates are compared as dates, so 09-05-1989 equals 09/05/1989. Text fields can use the date operators for the same reason.
- On or after and On or before include the boundary date; After and Before don't.
- When one side of a field-to-field comparison is blank, the check doesn't error: Equals holds only if both are blank, and ordering operators such as Greater than are false.
- Matches pattern uses a regular expression, case-insensitive, anywhere in the value; add
^and$to match the whole value (^INV-\d+$). Is one of takes a comma-separated list and compares numbers as numbers.
AI conditions
Some judgements can't be written as a rule. Text fields offer two AI operators, available in check conditions only (never in guards or branch conditions):
- AI match compares a value with another document's field, with your instructions, for example “Are these the same person? Names may omit a surname or be ordered differently.”
- AI check judges a single value, for example “Is this address inside Panama?”
You define the possible answers (at least two) and mark which ones pass; they show in green. The model answers with exactly one option, and the chosen option and its reasoning are recorded in the report. The answer is frozen with the inspection, so the verdict itself stays reproducible.
Suggest checks
Once the expected documents are in place, click Suggest checks in the checklist. Optionally describe what the inspector should verify (for example “Check that the invoice total matches the purchase order”), then click Suggest checks. The assistant reads the fields of each document, with sample values from the flow's latest completed run, and drafts checks with their severity and conditions.
Uncheck what you don't need, edit any check with the pencil, and click Add checks. Everything stays editable.
Dry run
The Dry run panel tests the checklist against completed runs: pick a sample run for each document, or No document (absent), and the verdict re-evaluates instantly as you edit. It uses the same rule engine as real inspections. Nothing is saved, and AI conditions are assumed to pass because the model only runs during real inspections.
Running an inspection
- 1Open the inspector's Inspections tab and click New inspection.
- 2Drop the documents for one inspection (PDF, PNG, JPG, JPEG, JFIF) and click Start inspection.
- 3AI routes each file into the right document slot, using its first page, the document name, the routing hint and the flow, and runs the slot's extraction flow.
- 4When every required document has a completed run, the checklist evaluates and the inspection page shows the verdict and the report.
On the inspection page you can keep adding documents while it is collecting. A file the AI couldn't place is marked Unmatched: choose a slot in Assign to document… and click Assign. Cancel stops an inspection without evaluating it.
Settings decides when the checklist runs: Automatic evaluates as soon as every required document has a completed run; Manual keeps collecting until someone clicks Fire now.
| Status | Meaning |
|---|---|
| Collecting | Accepting documents. Files are routed and their runs extract. |
| Waiting for runs | Fired, waiting for the last runs to finish. |
| Queued / Running | The checklist is being evaluated. |
| Awaiting approval | A reviewer must approve before the verdict is final. |
| Completed | The verdict and report are ready. |
| Failed | For example, a required document's run failed after the inspection was fired. |
| Cancelled | Cancelled by a user, or rejected in review. |
You can also run inspections:
- From a Subject case. An inspector bound to a Subject appears under Checks on the case page. Run reuses the case's completed runs, with no re-upload or re-extraction. Every required document needs a completed run in the case.
- In a Pipeline, as a node after the flows. See Pipelines.
- Over the API, described below.
An inspection keeps the documents and checklist it started with. Edits to the inspector apply to new inspections only.
Verdict and report
| Verdict | When |
|---|---|
| Fail | Any blocker failed or couldn't be evaluated (error). |
| Pass with warnings | No blocker failed, but at least one warning failed or errored. |
| Pass | No blocker or warning failed. Info checks never change the verdict. |
The Checklist report lists every check in order with its result (Pass, Fail, Skipped or Error), the values that were compared and a short explanation. Skipped checks say why: the branch wasn't taken, the guard wasn't met, or the document wasn't provided. A completed inspection can be downloaded as a PDF report.
Human review
In Reviewers & HITL, switch on Human review and pick reviewers to pause every inspection before the verdict is final. A failing check can also pause the inspection on its own with the Request review action. Reviewers are notified by email.
- 1Open the paused inspection. The review panel shows the failing checks and a Verdict preview.
- 2Waive any failing check that is acceptable, with a reason (required). Waived checks no longer count towards the verdict.
- 3Click Approve to finalise the verdict and send the outputs, or Reject to cancel the inspection without a verdict.
Every role, including HITL Only, can review. When reviewers are configured, only they can approve or reject. See Human in the Loop.
Outputs
- In-app notification with the verdict for whoever started the inspection.
- Email Output: receives the verdict and each check's result, with the PDF report attached.
- Webhook: POSTs JSON with
inspection_id,inspector_id,verdictand the full report inoutput_json. See Webhooks. - Per-check Send email and Call webhook actions fire for each failed check that wasn't waived.
With human review, outputs are sent after approval.
API
Send documents to an inspector with your API key. Copy the ID from Inspector ID on the inspector's page. Each request adds one file; leave out inspection_id on the first one to open a new inspection, then pass the returned ID with the others.
curl -X POST https://run.tavnit.io/api/inspectors/<inspector_id>/process \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@commercial_invoice.pdf"
curl -X POST https://run.tavnit.io/api/inspectors/<inspector_id>/process \
-H "X-API-Key: YOUR_API_KEY" \
-F "file=@packing_list.pdf" \
-F "inspection_id=<inspection_id>"- The response is
202withinspection_idandinspection_file_id. A402means your organization can't start new work right now; contact the Tavnit team. - With the Manual policy, finish with
POST https://run.tavnit.io/api/inspections/<inspection_id>/fire. It returns400withmissing_inputsif a required document hasn't arrived. - Configure a Webhook on the inspector to receive the verdict and report.
Authentication is covered in API Integration.
Permissions
- Admins and Owners create inspectors. Admins, Owners and the inspector's creator can edit or delete it.
- Every member except HITL Only can run inspections.
- Every role can review paused inspections.
- Deleting an inspector also deletes its inspections and their reports.
Troubleshooting
| Problem | What to do |
|---|---|
| New inspection is unavailable | The inspector is inactive. Turn it on with the Active switch in the header, or ask an admin. |
| You can't add documents | Documents need an active extraction flow. Create a flow first, then come back. |
| A file stays Unmatched | The AI couldn't place it, or its slot is already filled. Assign it by hand, and add a routing hint to the document so future files route correctly. |
| The inspection never evaluates | A required document is still missing, its run is still processing, or the policy is Manual. Upload the missing file or click Fire now. |
| A check shows Error | A value couldn't be read (missing field, unparsable number or date, invalid pattern). The report shows the values; fix the field in the flow or the condition. |
| A blocker was skipped instead of failing | It reads an optional document that was absent, or its guard didn't hold. Make the document required if the check must always run. |
| Checks reference a removed document | Point the conditions at another document; until then those checks don't run. |
| A date check against Today gives an unexpected result | Today is taken in your organisation's timezone at evaluation time. Check the date element and the operator (After vs On or after). |
