0038: Onboarding Pipeline to Workflow Mapping
Date: 2025-11-08
Status: Proposed
Context
As established in ADR-0037, the onboarding-service is a stateless adapter. Its API exposes the concept of a "pipeline" (e.g., StandardKYC, EmployeeInvite) to its clients. However, the underlying workflow-service operates on more generic workflowName identifiers (e.g., tenant-onboarding-v1).
We need a mechanism to translate the abstract pipeline name into a concrete, versioned workflow definition that the workflow-service can execute. Hardcoding this logic would make the system rigid and require a full service redeployment to add or change an onboarding process.
Decision
We will implement a configuration-based mapping strategy within the onboarding-service.
-
Configuration: A configuration source (e.g., a YAML file, environment variables, or a central config service) will hold a map of
pipelineNametoworkflowName.Example (YAML):
onboardingPipelines:
StandardKYC: tenant-onboarding-v1
EmployeeInvite: user-onboarding-v1 -
Runtime Lookup: When the
onboarding-servicereceives a request (e.g.,POST /onboarding/startwithpipelineName: "StandardKYC"), it will perform a lookup in its loaded configuration to find the correspondingworkflowName(tenant-onboarding-v1). -
Dispatch: It will then use this resolved
workflowNameto start the correct process in theworkflow-service.
Consequences
Positive
- Flexibility: New onboarding processes or versions can be introduced by simply updating the configuration, without any code changes or service redeployment.
- Decoupling: The public API contract (
pipelineName) is cleanly decoupled from the implementation detail (workflowName), which can evolve independently. - Versioning: This pattern provides a simple way to version onboarding flows. We can introduce
tenant-onboarding-v2and update the configuration to point theStandardKYCpipeline to the new workflow.
Negative
- Configuration Management: The pipeline mapping becomes a critical configuration artifact that must be managed, versioned, and deployed carefully.
- Runtime Errors: A request with an unknown
pipelineNamewill result in a runtime error (e.g., a404 Not Foundor400 Bad Request), which the service must handle gracefully.