Skip to content

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

Normative: this is the rule
  1. 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).
  2. A cancel MUST be refused with INWARD_SIGNAL_ALREADY_PENDING only while another cancel signal is pending for the run.
  3. A pause MUST be refused with it while any inward signal is pending for the run.
  4. A cancel accepted for a paused run ends it at once (INT-25).
  5. A client can classify a refusal by that code; the message wording is not a contract and an implementation MAY change it.
  6. A refusal MUST carry its code as API-8 requires.
  7. A newly created cancel or pause signal MUST be answered 202.
  8. A resume that resolved a pending pause MUST be answered 200.
  9. A signal addressed to a run that does not exist MUST be answered 404 with the code NOT_FOUND for a caller holding blanket authority over runs (existence is no secret from someone who can act on any run).
  10. For every other identified caller it MUST be answered with an opaque 403 with the code ACCESS_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

Cancelling a run that has already finished409 — PIPELINE_TERMINAL
POST /api/flowdrop/pipeline/{pipeline_id}/cancel

{}
Pausing a run for the first time202 — accepted
POST /api/flowdrop/pipeline/{pipeline_id}/pause

{}
Resuming that same pause200 — resolved
POST /api/flowdrop/pipeline/{pipeline_id}/resume

{}
Cancelling a run that is paused, its pause signal still pending202 — accepted
POST /api/flowdrop/pipeline/{pipeline_id}/cancel

{}
Cancelling a running run whose first cancel is not yet observed409 — INWARD_SIGNAL_ALREADY_PENDING
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.

Why

Recorded under OPEN-18, OPEN-25, OPEN-48, OPEN-61, OPEN-65.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · INT-16 · changed in spec 1.1