A refused signal says why in a code a client can act on
Three different refusals share one status code, and a client has to tell them apart to say anything useful to an operator. The discriminator is a stable code, not the wording of a message.
The rule
- The signal API MUST refuse in three distinguishable ways, all with
409, each carrying a stable machine-readable code beside its human-readable message: the run is in a terminal state and cannot be signalled or resumed (PIPELINE_TERMINAL); the signal would join one already pending for the run (INWARD_SIGNAL_ALREADY_PENDING); and there is no active pause to resume (NO_ACTIVE_PAUSE). - A cancel MUST be refused with
INWARD_SIGNAL_ALREADY_PENDINGonly while another cancel signal is pending for the run. - A pause MUST be refused with it while any inward signal is pending for the run.
- A cancel accepted for a paused run ends it at once (INT-25).
- A client can classify a refusal by that code; the message wording is not a contract and an implementation MAY change it.
- A refusal MUST carry its code as API-8 requires.
- A newly created cancel or pause signal MUST be answered
202. - A resume that resolved a pending pause MUST be answered
200. - A signal addressed to a run that does not exist MUST be answered
404with the codeNOT_FOUNDfor a caller holding blanket authority over runs (existence is no secret from someone who can act on any run). - For every other identified caller it MUST be answered with an opaque
403with the codeACCESS_DENIED, indistinguishable from the answer for a run that exists but is not theirs, so that the route cannot be used to enumerate which runs exist.
What it means
Three different refusals on the signal API share the one status, 409, so
the status alone cannot tell an operator which of the three happened; the
error_code is what does. A code, once published, keeps its meaning
forever — API-8 covers that guarantee for two of the three codes here; the
third, PIPELINE_TERMINAL, is the same contract applied to a run that has
already finished.
The pending-signal refusal is not symmetrical. A pause is refused while any signal is pending, because a pause on top of a pending cancel or a pending pause has nothing left to do. A cancel is refused only while another cancel is pending. A paused run's pause signal stays pending as its resume key, and a cancel refused because of it would force the operator to resume the run, and run its nodes again, just to stop it. The cancel ends the paused run directly instead (INT-25).
Success is not one code either: creating a new signal and resolving one that already existed are different events on the same endpoint, and they answer differently so a caller can tell which happened without inspecting the body.
The existence check on a missing run is scoped to who is asking. A caller
who can already act on any run loses nothing by being told a run does not
exist, so they get an honest 404. Everyone else gets the same opaque
403 whether the run does not exist or simply is not theirs — the two
cases are indistinguishable on purpose, because otherwise the difference
between them becomes a way to enumerate which runs exist.
Example
POST /api/flowdrop/pipeline/{pipeline_id}/cancel
{}POST /api/flowdrop/pipeline/{pipeline_id}/pause
{}POST /api/flowdrop/pipeline/{pipeline_id}/resume
{}POST /api/flowdrop/pipeline/{pipeline_id}/cancel
{}POST /api/flowdrop/pipeline/{pipeline_id}/cancel
{}A caller with blanket authority over runs who cancels one that does not
exist gets 404; every other caller gets 403 for that same request, and
403 again for a run that exists but is someone else's — the two answers
are identical on purpose.
The paths are examples of the routes API-9 names pipeline_cancel, pipeline_pause
and pipeline_resume.