process-flows
The ordered stages of process paths a workload passes through (ADR 0042)
List process flows
Returns only ACTIVE flows by default; pass ?all=true for the audit view (ACTIVE and RETIRED). The list is keyset-paginated (REST guideline section 3): `limit` (1-500, default 100) and an opaque `cursor`, in flowId order (the unique key); the answer is `{items, nextCursor}` and `nextCursor` is absent on the last page. Filters (`all`) are repeated on every page request. Any query parameter other than `all`, `limit` and `cursor` is 400 `unknown-query-parameter`.
Get one process flow by id
Returns the flow regardless of status (ACTIVE or RETIRED).
Define or revise a process flow
The ordered stages a workload passes through (ADR 0042). The body is the flow's FULL definition: every PUT replaces the name and the stages. Idempotent by nature (full state), so it takes no Idempotency-Key. 201 when the flowId is new, 200 for every later PUT — including one that changes nothing, which raises no event and keeps the version. Each accepted change raises ProcessFlowDefined (first) or ProcessFlowRevised, carrying the full state and a `version` that starts at 1 and grows by one per accepted change. Invariants: at least one stage; a pathId appears at most once; each processType is one of the closed set; each stage's pathId names an ACTIVE process path of this service's own catalogue (checked at write time, under the path's row lock). A RETIRED flow cannot be revised (422 `flow-retired`).
Retire a process flow
Idempotent: retiring an already retired flow is a 204 again and does NOT republish. The first retirement raises ProcessFlowRetired, the full state with status RETIRED and the next version. A retired flow cannot be revised, and its paths may be deactivated again.