Skip to content

Workflows

A workflow is a JSON document ("schema": "rightful.workflow/v1") that says which checks a session runs, what happens when a check is unclear or fails, how the final decision is made, and what the result contains. The full field list is in the workflow DSL reference.

  • PUT /v1/workflows/{key} saves a new immutable version every time and, by default, activates it.
  • A session pins the version that was active when it was created. Changing a workflow never changes a session already under way.
  • POST /v1/workflows/{key}/activate?version= rolls back to an earlier version.
  • POST /v1/workflows/validate checks a definition without saving it, and returns the effective plan with every default policy filled in.

Steps run in the order listed. There are two kinds.

Capture steps run on the hosted page, at most once each, always in this order:

Step What the person does
gestures One to five gestures from SMILE, OPEN_MOUTH, BLINK, TURN_LEFT and TURN_RIGHT, drawn at random on every attempt. Always the first capture step.
light Holds still while the screen shows a colour sequence; the server checks the face reflects it.
id_portrait Photographs their ID, on the same device or with their phone through a QR code. Needs a light step before it.
voice_enrol Reads random digits aloud after the light check, so later recordings can be checked for the same voice. Optional for the person; a review-only signal. See Voice consistency.

Server checks use what was captured, and run on the server only:

Step What it checks
face_match 1:1 match of the live face against a reference photo you send, an earlier id_portrait step, or the face kept from an earlier session.
name_match The name printed on the ID against the subject_name you send.
id_expiry The ID has not expired, optionally with some days of validity left.
id_barcode For a licence or photo card, the barcode on the back agrees with the front.
voice_match The voice enrolled in this session sounds like one enrolled in an earlier session of the same person. Can send to review, never decline.

A workflow has at most ten steps.

Every step ends in one outcome: passed, inconclusive, failed or capture_error (a step can also be skipped: a voice step the person declined, or a light check they skipped where the light step’s skip setting allows it). For each outcome other than passed, the step’s on block chooses a policy:

  • retry (capture steps only): run the whole capture chain again with fresh random challenges, up to max times, then apply then;
  • review or decline, with an optional reason;
  • continue (server checks only): carry on, but an approve at the end becomes review.

A light mismatch can never be retried. When a step has no policy for an outcome, the defaults apply: retry twice on capture_error, retry once on inconclusive, and review otherwise.

When every step has run without a final policy, the decision block decides:

  • all_passed (the default): approve when every step passed, else otherwise (default review);
  • rules: a list of rules checked in order, each if a condition on a step’s outcome or face-match band, then approve, review or decline.

What the workflow decides is the declared decision. Whether it stands depends on your app’s settings; see decisions and assurance.

  • output.detail chooses how much each result says: verdict (no per-step checks), checks (the default: each step’s outcome and reasons) or scores (adds raw measurements).
  • output.evidence chooses which images, if any, are kept for your reviewers. See evidence and retention.