Workflows
A workflow decides what happens to a case after the applicant sends evidence. It is a graph: requirement nodes wait for evidence, check nodes read it, branches pick a path, and outcome nodes end the path.
The graph
A profile's workflow is saved as a draft and published as a version. A case runs the version that was published when it was created. The definition holds the nodes, the edges between them and whether the workflow may decline a case.
This graph waits for the form, sends the answers to your risk service, approves when the service says so and sends every other case to review:
{
"graph": {
"nodes": [
{
"id": "details",
"type": "requirement",
"config": {
"ref": "form"
}
},
{
"id": "risk",
"type": "api",
"label": "Risk score",
"config": {
"connection_id": "01a20025-8d62-7335-a0f6-df4f31e4d374",
"include": [
"details"
],
"rules": [
{
"path": "nodes.risk.output.body.score",
"op": "gt",
"value": 50,
"outcome": "in_review",
"reason": "High risk score"
}
]
}
},
{
"id": "decide",
"type": "branch",
"config": {
"cases": [
{
"label": "Approve",
"match": "all",
"conditions": [
{
"path": "nodes.risk.output.body.decision",
"op": "equals",
"value": "approve"
}
]
}
]
}
},
{
"id": "approve",
"type": "outcome",
"config": {
"status": "approved"
}
},
{
"id": "review",
"type": "outcome",
"config": {
"status": "in_review"
}
},
{
"id": "manual",
"type": "outcome",
"config": {
"status": "in_review"
}
}
],
"edges": [
{
"from": "details",
"to": "risk"
},
{
"from": "risk",
"to": "decide"
},
{
"from": "risk",
"to": "manual",
"on": "failed"
},
{
"from": "decide",
"to": "approve",
"on": "Approve"
},
{
"from": "decide",
"to": "review",
"on": "default"
}
]
},
"auto_decline": false
} - Node IDs are lowercase names of up to 40 characters. A graph has at most 100 nodes and 200 edges.
- An edge is
{from, to, on}.onnames a branch case label ordefaulton edges that leave a branch, andfailedon the failure edge of anapinode. - The graph cannot loop back to an earlier node.
- A node waits until every incoming edge has been decided. An edge is dead when its source was skipped, failed, ended its path through a rule, or is a branch that chose another case. A node whose incoming edges are all dead is skipped, so a node that joins two branches still runs when one of them was not taken.
- A path that ends on a node that is not an outcome is saved with a
path_without_outcomewarning. Cases that reach it go to review.
Manage the default workflow of a profile with GET /compliance-profiles/{id}/workflow, PUT .../workflow/draft and POST .../workflow/publish. Send the expected_revision and profile_hash from the workflow state with each save and publish. A stale revision returns 409.
Node types
| Type | Config | Output |
|---|---|---|
requirement | ref: group:<key> for a document group, document:<document type id> for a document outside any group, check:<verification type>, or form | items, and answers for the form |
check | capability, settings and ordered rules | Depends on the capability, see below |
branch | Ordered cases, each {label, match, conditions} with match all or any | branch: the label of the first case that matches, else default |
action | type: tag, untag, note, metadata (with key and value) or flag (with value and an optional reason) | None |
outcome | status: approved, in_review or declined | Ends the path |
api | connection_id, include, optional label and ordered rules | status, body, duration_ms. See Call your API. |
Each requirement of the profile has exactly one requirement node. GET /workflow-node-types lists every type and check capability for the selected environment, with its outputs, its price and whether it can run there. A check with available: false has an unavailable_reason: provider_not_configured or not_enabled.
Check capabilities
Capability What it does Outputs document.parseReads the text, pages and tables of the submitted documents. output.run_id (string)
output.status (string)
output.pages (number)
verdict (string)document.extractExtracts the configured fields from the documents read before it. output.run_id (string)
output.status (string)
output.fields (object)
output.field_confidence (object)
verdict (string)livenessChecks the selfie gestures the applicant performed. output.passed (boolean)
output.gestures (array)
output.video (boolean)
verdict (string)locationChecks the accuracy, age, mock flag, network country and reference places of the shared location. output.location_checks.accuracy_m (number)
output.location_checks.fix_age_s (number)
output.location_checks.is_mock (boolean)
output.location_checks.ip_country.result (string)
output.location_checks.ip_country.ip_country (string)
output.location_checks.ip_country.location_country (string)
output.reference.outcome (string)
verdict (string)face.matchCompares the selfie with the face on the identity document. Fails to review when no provider is configured. output.score (number)
output.threshold (number)
output.match (boolean)
output.faces_found.reference (boolean)
output.faces_found.probe (boolean)
output.faces.reference (object)
output.faces.probe (object)
output.reference_file_id (number)
output.probe_file_id (number)
output.error_code (string)
verdict (string)aml.screenScreens the extracted name, birth date and nationality against sanctions, PEP and crime lists. Fails to review when no provider is configured. output.match_score (number)
output.topics (array)
output.matches (array)
output.error_code (string)
verdict (string)poa.validateCompares the name on the proof of address with the identity document and checks its issue date and address. output.name_score (number)
output.issued_months_ago (number)
output.issued_within_max_age (boolean)
output.max_age_months (number)
output.address (string)
verdict (string)emailReads the confirmed email address, its domain and whether the domain is disposable. output.email (string)
output.domain (string)
output.disposable (boolean)
output.verified (boolean)
verdict (string)phoneReads the confirmed phone number. output.phone (string)
output.verified (boolean)
verdict (string)
Face match, screening, proof of address and the email and phone checks are described in Checks and questions. Reading and field extraction need an administrator to enable them on the deployment.
Conditions
Branch cases, check rules and api rules test conditions of the form {path, op, value}. A condition can read:
Path Value nodes.<id>.output.<path>An output of a node earlier on the same path, such as nodes.risk.output.body.score. nodes.<id>.verdictThe verdict of a check or api node: continue, in_review or declined. form.<key>An answer to a question. case.metadata.<key>Metadata on the case, including values set by metadata actions. applicant.countryA two letter code from an extracted nationality, country or issuing_country, else the country of the location fix. applicant.ageYears since an extracted date_of_birth. applicant.nameAn extracted full_name or name, or first_name and last_name. applicant.date_of_birthThe extracted date_of_birth.
Workflow conditions and question conditions use the same operators:
Operator valueTrue when equalsOne value The value equals it. Numbers and numeric strings compare as numbers. When either side is a boolean, both are read as booleans. Lists compare item by item. Anything else compares as text, case sensitive. not_equalsOne value The value is present and equals is false. gtOne value Both sides are numbers, or both are ISO dates, and the value is greater. gteOne value As gt, or equal. ltOne value Both sides are numbers, or both are ISO dates, and the value is smaller. lteOne value As lt, or equal. containsOne value A list has an item that equals it, or a text contains it, ignoring case. not_containsOne value The value is present and contains is false. inA list of up to 100 values The value is not a list and equals one of them. not_inA list of up to 100 values The value is present and in is false. is_emptyNone The value is missing, "" or []. false and 0 are not empty. is_not_emptyNone is_empty is false. regexA pattern of at most 200 characters The value is not a list and the pattern matches part of it, case sensitive. An invalid pattern is false. fuzzy_match{"text": "...", "min_score": 0 to 100} Similarity of the two texts, ignoring case and extra spaces, is at least min_score (80 when absent).
Missing values. A value is missing when its path does not exist or holds null. A missing value makes every operator false except is_empty. The negated operators not_equals, not_contains and not_in are false too, so an absent metadata key never matches not_equals. To act on a missing value, test it with is_empty.
Rules and outcomes
Check and api nodes take ordered rules of {path, op, value, outcome, reason}, up to 20 per node. The first rule that matches sets the node's verdict:
continue lets the path go on. It is also the verdict when no rule matches. in_review ends the path and sends the case to review with reason. declined ends the path and declines the case.
When every reachable node has finished, the case gets the worst outcome reached: declined, then in review, then approved. Approved and declined are recorded as a decision by the workflow actor. In review leaves the case for a person, with metadata.review_reason naming the node, the rule and the reason. A check that fails, and an api node that fails without a failure edge, send the case to review. Account verification cases always go to review.
Automatic decline is off by default
auto_decline is false unless you set it. While it is off, saving a declined outcome or a rule with outcome: "declined" returns 422 with "Turn on automatic decline before a path can decline a case." With it off, a workflow can approve a case or send it to review, and only a person declines.
Requirements added during a case
A requirement node without incoming edges is asked for when the case is created. A requirement node with incoming edges is conditional: it is asked for only when the engine reaches it. For example, put a check:phone_verification requirement after a branch on form.country.
When a conditional requirement is reached, its items are added to the case, the case returns to in progress, the applicant gets the change request email, and the hosted page and the SDKs show the new items on their next load. A conditional form stays hidden until it is reached. The timeline records a requirement_added event, and result webhooks send case.requirement_added. The SDKs fetch the session again after every submission to pick these up; see after a submit.
After a change request, a resubmission runs the nodes after that requirement again.
Dry run
POST /compliance-profiles/{id}/workflow/dry-run runs a draft definition without side effects. It creates no jobs, records or mail and never calls a connection. Give it either sample values in context or a case_id whose recorded outputs it replays.
context fieldHolds nodes.<id>.output and nodes.<id>.verdictSample outputs for up to 100 nodes. formSample answers. case.metadataSample case metadata. applicantcountry (two letters) and age.
With the graph above and {"context": {"nodes": {"risk": {"output": {"status": 200, "body": {"decision": "approve", "score": 12}}}}}}, the dry run returns:
{
"success": true,
"message": "Operation successful",
"data": {
"path": [
"details",
"risk",
"decide",
"approve"
],
"nodes": {
"details": {
"status": "done"
},
"risk": {
"status": "done",
"verdict": "continue"
},
"decide": {
"status": "done",
"branch": "Approve"
},
"manual": {
"status": "skipped"
},
"approve": {
"status": "done"
},
"review": {
"status": "skipped"
}
},
"outcome": "approved",
"reasons": [
{
"status": "approved",
"node_id": "approve",
"rule_index": null,
"reason": null
}
],
"requirements_added": []
}
}
The response lists the path taken, each node's status, branch, verdict and rule, the outcome with its reasons, and the conditional requirements the run would add in requirements_added. An api node without a sample output reports waiting. A sample output with error_code reports failed and follows the failure edge.
Cost
Every node type and check capability has a price per case, listed in price by GET /workflow-node-types. Prices and their currency are set for each deployment. The workflow state and every draft save return cost, with the total per case and the amount of each node, next to warnings:
{
"warnings": [],
"cost": {
"per_case": {
"amount": 0,
"currency": "USD"
},
"items": [
{
"node_id": "details",
"amount": 0
},
{
"node_id": "risk",
"amount": 0
},
{
"node_id": "decide",
"amount": 0
},
{
"node_id": "approve",
"amount": 0
},
{
"node_id": "review",
"amount": 0
},
{
"node_id": "manual",
"amount": 0
}
]
}
}
Case timeline
GET /workflow-cases/{id}/timeline returns the events and node runs of a case. With client credentials, use GET /client/workflow-cases/{id}/timeline.
Event Recorded when requirement_completedA requirement's evidence is complete. requirement_addedA conditional requirement was reached and added to the case. node_started, node_finished, node_failedA node starts, finishes or fails. rule_firedA rule matched, with its index, outcome and reason. branch_takenA branch chose a case. action_appliedAn action tagged, noted, flagged or set metadata. api_calledOne attempt to call your API. provider_calledOne attempt to call a face match or screening provider. node_recoveredA node left running was queued again or given up. outcome, decision, status_changedThe workflow reached an outcome, recorded a decision or changed the case status.
For the graph above, a risk score of 71 sends the case to review. The timeline, trimmed to the risk node:
{
"events": [
{
"id": 2,
"type": "node_started",
"node_id": "risk",
"data": {
"connection_id": "01a2044a-4717-7363-a82f-5b20b064af95",
"event_id": "739bb3a5-6f1e-5d2f-b099-827928a47c25"
},
"created_at": "2026-11-22T17:25:06.000000Z"
},
{
"id": 3,
"type": "api_called",
"node_id": "risk",
"data": {
"attempt": 1,
"status": 200,
"duration_ms": 110,
"response_sha256": "d27687fc3fb95ab22cf2a294a8c9d67797bc9c7c76ab9810dd58abe744909dff"
},
"created_at": "2026-11-22T17:25:06.000000Z"
},
{
"id": 4,
"type": "node_finished",
"node_id": "risk",
"data": {
"status": 200,
"duration_ms": 110,
"verdict": "continue"
},
"created_at": "2026-11-22T17:25:06.000000Z"
}
],
"node_runs": [
{
"node_id": "risk",
"status": "done",
"output": {
"status": 200,
"body": {
"decision": "approve",
"score": 12
},
"duration_ms": 110
},
"verdict": "continue",
"rule_index": null,
"reason": null,
"attempts": 1,
"started_at": "2026-11-22T17:25:06.000000Z",
"finished_at": "2026-11-22T17:25:06.000000Z"
}
],
"outcome": {
"status": "approved",
"node_id": "approve",
"rule_index": null,
"reason": null,
"at": "2026-11-22T17:25:06+00:00"
}
}
The engine runs each node once per case, so repeated triggers change nothing. If an api or provider check node is still running after 10 minutes, for example after a lost job, it is advanced from its stored result or queued again, and the first answer wins. After 60 minutes it fails with timeout or provider_unavailable.