You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow client flows with zero or multiple TASK nodes in caseflow #449
ClientFlows.Owner in platform/caseflow (moved from nsw-srilanka in #443) derives the owning roles for a client-started flow from the workflow definition's TASK node, and requires the workflow to have exactly oneTASK node with non-empty read.roles. Both startup validation (Config.CheckWorkflows) and Service.StartFlow reject any client flow that violates this.
This blocks starting general workflows via POST /api/v1/internal/cases/{caseId}/flows:
Multi-step workflows with two or more TASK nodes (e.g., officer review followed by supervisor approval, or a human task alongside an automated API_CALL/COMPUTE task node).
Purely automated M2M workflows with zero TASK nodes (or only automated tasks with empty read.roles).
Suggested Improvement
Relax ClientFlows.Owner (backward-compatibly, with no config or API break):
Collect and union read.roles across all TASK nodes in the workflow (ignoring automated task templates with empty read.roles, and considering SUBWORKFLOW nodes if applicable). Per-task readauthz and step authz still restrict each role to its own tasks and commands, so granting the union on case_parties remains safe.
When no task declares read.roles (a purely automated flow), return a nil owner (writing no case_parties rows) rather than failing, and update CheckWorkflows accordingly while still validating that every role named in read.roles exists in catalog.Roles.
Activity