Skip to content

Allow client flows with zero or multiple TASK nodes in caseflow #449

Backlog

Description

@lokewate

Current Limitation

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 one TASK 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.

Additional Context

Part of the cleanups after OpenNSW/nsw-srilanka#1248's moves. Related to #443.

Activity

  1. added
    nsw-sl cleanup
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    nsw-sl cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions