Skip to content

Driver onboarding ​

Onboarding a driver on their phone: the flow takes the city, age, years licensed and photos of the licence and insurance, four rules decide, and drivers who need a look go to the onboarding team. Pack: examples/policies/driver-onboarding/.

A pattern for expressing a gig & on-demand work policy, not compliance guidance: the thresholds, lists and fields are placeholders chosen to make the example run; a real policy comes from the business's own rules. It calls no app, so it runs in an empty workspace as it is.

The decision it automates ​

Whether to activate the driver, refer them to the onboarding team, or reject the application, when it is submitted.

Data expected ​

  • The driver as a subject (kind user) with identityMatch, your identity check's result (for example Sumsub's selfie and document check), written before the run starts.
  • The flow's answers under submission: fullName, city, age, yearsLicensed and optional photos of the licence and insurance.

Steps and rules ​

StepTypeWhy
collectwait_for_collectionThe driver-application flow; the photo fields take the phone's camera.
rulesevaluate_rulesThe driver-onboarding rule set under max_severity.
routebranchrules.outcome == manual_review opens a case.
reviewcreate_casedriver_onboarding, 8-hour SLA.
decideemit_decisionFrom the rules, or the reviewer's decision.

The rule set driver-onboarding (useCase: onboarding) uses max_severity: a failed block rule rejects, a failed warn rule sends the run to review, and the weights add up to the score.

RuleTypeSeverity, weightFails when
gig_city_supportedcomparisonblock, 100city is not London, Berlin or Singapore
gig_minimum_agecomparisonblock, 100age is under 21
gig_identity_matchcomparisonblock, 100subject.identityMatch is not true
gig_licence_experiencecomparisonwarn, 30yearsLicensed is under 2

What a reviewer sees ​

A driver_onboarding case with the answers, the photos and each rule's result.

How to adapt it ​

Install the Sumsub app and call it in the workflow instead of trusting the subject's flag, add your background-check provider as an asynchronous app, and have your scheduler start the workflow again before a licence or insurance certificate expires.

Run it ​

bash
pnpm policy:import examples/policies/driver-onboarding --publish

The fixture is a 27-year-old in London licensed for one year: the experience rule fails, a driver_onboarding case opens, the check approves it and the run completes with a manual approve.

Released under the Apache-2.0 License.