Define or revise a process flow
PUT/process-flows/:flowId
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).
Request
Responses
- 200
- 201
- 400
- 409
- 422
- 500
Flow revised, or the request changed nothing (no event, same version)
Flow defined (ProcessFlowDefined at version 1)
The request body is missing, not valid JSON, or contains a NUL character U+0000 (malformed-request-body).
concurrent-modification: another request committed a change to this flow between the caller's load and this write (optimistic concurrency, ADR 0017). Reload the flow and re-apply the change.
name is empty, stages is empty, a stage's pathId is empty or repeated (duplicate-stage-path), a processType is not one of the closed set (invalid-process-type), a stage's pathId does not reference an Active process path (ineligible-stage-path), or the flow is retired (flow-retired).
An unexpected error (problem type internal-error): a storage or other infrastructure failure, or a recovered panic. On POST /process-paths a 5xx is never stored under the Idempotency-Key, so a retry with the same key runs again.