This is a temporary solution until form builder fully powers the workflow UI. Currently, workflows handle orchestration only while service requests maintain business context (files, assignees, corporations, etc.).
Architecture overview
Service request configuration
For each service request type, we maintain a configuration defining:- Which task groups exist
- Which tasks belong to each group
TaskGroup and Task enums.
At runtime, this configuration generates service request instances on the backend.
Frontend rendering
The frontend uses acomponentMap that maps each taskKey to a React component:
- Look up the
taskKeyincomponentMap - If found, render the custom component
- If not found, render a Generic Task (assigned to an agent, “Mark as Completed” behavior)
Workflow as source of truth
When a service request is initiated:- Check if a workflow link exists for that service request type
- If yes, start a workflow execution
- The workflow execution becomes the source of truth for task statuses
Syncing task updates
When updating a task in the service request:Mapping workflows to service requests
When creating a new workflow, connect it to a service request using these fields:Workflow level
Step group level
Step level
Mapping flow
- Select the
legacyServiceRequestType - Select the
taskGroupfor eachstepGroup - For each step, select the
taskKey
Component rendering logic
Handling dynamic DSC task groups
The India Pvt Ltd incorporation workflow requires dynamic task groups—each director without a DSC goes through a separate DSC onboarding flow.Domain mismatch
| Domain | Representation |
|---|---|
| Workflow | One child workflow per director |
| Service Request | Separate task group per DSC workflow |
Current solution
- Identifies DSC-related child workflow executions
- Creates/updates corresponding Service Request task groups
- Links each task group to the correct
workflowExecutionId - Ensures group names and ordering follow SR UI conventions
Update routing
- If task belongs to a DSC group → update child workflow execution
- Otherwise → update parent workflow execution
Future considerations
We have not yet generalized this pattern. Open questions include:
- Should all child workflows appear as Service Request task groups?
- Should child-of-child workflows be shown?
- How should workflows with multiple step groups be projected?
- Should we introduce a generic “projection type” system?
Next steps
Data models
Database schema reference
Creating workflows
Build workflows with legacy mapping