Appearance
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) withidentityMatch, 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,yearsLicensedand optional photos of the licence and insurance.
Steps and rules
| Step | Type | Why |
|---|---|---|
collect | wait_for_collection | The driver-application flow; the photo fields take the phone's camera. |
rules | evaluate_rules | The driver-onboarding rule set under max_severity. |
route | branch | rules.outcome == manual_review opens a case. |
review | create_case | driver_onboarding, 8-hour SLA. |
decide | emit_decision | From 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.
| Rule | Type | Severity, weight | Fails when |
|---|---|---|---|
gig_city_supported | comparison | block, 100 | city is not London, Berlin or Singapore |
gig_minimum_age | comparison | block, 100 | age is under 21 |
gig_identity_match | comparison | block, 100 | subject.identityMatch is not true |
gig_licence_experience | comparison | warn, 30 | yearsLicensed 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 --publishThe 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.