Implementation Plan
Plan to implement onboarding flows — create sessions, complete onboarding, and interact with Platform. Includes visual diagrams.
Overview
This document abstracts the developer from the core Guardline layer. You only interact with:
- Platform (aml_web_frontend) — Compliance dashboard: People, Legal, Manual Onboarding, Onboarding Flow editor
- Onboarding Web (kyx_onboarding_web) — Hosted flow where end users complete KYC/KYB
- Frontend Composer (optional) — BFF that proxies session creation to the Workflow Engine
The Workflow Engine (BFF) and templates are managed internally. You create sessions and redirect users to the onboarding URL.
1. Creating a Flow Session
Flow Diagram
Direct Integration (Platform → Workflow Engine)
When Platform calls the Workflow Engine directly (bypassing Composer):
Request / Response
Request:
POST /flow-sessions
Content-Type: application/json
{
"tenantId": "398b985e-019c-4f1f-98b6-4a080543cb9d",
"templateType": "KYC"
}Response:
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"url": "https://onboarding.guardline.io/v2/{tenantId}/onboarding?sessionId={token}"
}Platform usage: Use kyxTemplateService.createFlowSession(flowType, tenantId) which calls POST /api/kyx-sessions. The Platform BFF proxies to the Workflow Engine.
2. Flow Completion Lifecycle
Step-by-Step Flow Diagram
Module Completion Flow
Session Statuses
| Status | Description |
|---|---|
NOT_STARTED | Session created, user has not begun |
IN_PROGRESS | User has completed at least one module |
COMPLETED | All modules finished |
ABANDONED | Session abandoned / expired |
3. Interacting with the Frontends
Platform (aml_web_frontend)
| Page | Purpose |
|---|---|
| People | KYC list — applicants who completed KYC flow |
| Legal | KYB list — organizations that completed KYB flow |
| Manual Onboarding | Choose KYC or KYB → embeds iframe with onboarding URL |
| Onboarding Flow | Configure flow templates (modules, fields) |
| Dashboard | Metrics for KYC/KYB/Transactions |
Creating a session from Platform: Manual Onboarding uses useFlowSession(flowType, tenantId) which calls createFlowSession → renders an iframe with the onboarding URL.
Onboarding Web (kyx_onboarding_web)
| Screen | Purpose |
|---|---|
| CreateSession | Welcome + Start button → creates session, redirects to onboarding URL |
| Onboarding Flow | Steps: Terms → Document → Form → Liveness → Success |
| Route | /{tenantId}/onboarding?sessionId={token} |
Entry point: User lands on /{tenantId}/create-session or receives a link. Clicking "Start" triggers session creation and redirects to the flow.
Frontend Composer (optional)
Acts as a BFF. Platform can call:
POST /api/kyx-sessionswith{ flowType, tenantId }- Composer calls Workflow Engine
POST /flow-sessions - Returns
{ token, url }to Platform
4. Summary: What the Developer Must Know
- Create session: Call
POST /flow-sessions(or Platform’s/api/kyx-sessions) withtenantIdandtemplateType. - Redirect user: Use the returned
url(contains JWT insessionIdquery param). - User completes flow: Onboarding web fetches config from Workflow Engine, shows steps, and calls
PUT .../modules/{moduleId}/completefor each step. - Post-completion: Applicant appears in People (KYC) or Legal (KYB) in the Platform.
No need to understand Workflow Engine internals, templates, or MongoDB—only the public flow creation and completion APIs.