Cancel and pause signals are observed between job iterations
A signal never interrupts a job mid-flight. It is observed at the boundary between iterations, which is why a cancelled run has no half-executed node.
The rule
- An engine MUST poll for a pending signal between job iterations.
- The in-flight job MUST always finish first, and the absence of a signal MUST continue the loop.
- A cancel signal MUST mark the run cancelled and MUST stamp its execution time.
- The cancel signal MUST then be set
resolved, since it has been acted on (INT-24), as INT-25 sets it for a paused run, whether or not the cancel wins the run's terminal claim (INT-11). - The engine MUST then announce the outcome twice: a cancellation event and a run-completed announcement carrying the cancelled status, so that cancellation is announced like any other terminal outcome (ORC-15).
- It MUST then answer with status
cancelledand metadata naming the engine, the signal and the reason. - A pause signal MUST pause the run and MUST announce only the pause, with no completion announcement.
- The engine MUST then answer with status
pausedand the same metadata keys. - It MUST leave the signal record pending, because that record is the run's resume key.
- A cancel accepted while the run is paused is not observed here, since no loop is running: INT-25 ends that run at once.
- A run that is only polling (PIPE-11) has no job boundary to wait for, and PIPE-11 says how a signal takes effect on it.
What it means
A cancel and a pause are both observed only at the boundary between job iterations, never mid-node — the job already running always finishes first. Past that boundary the two diverge in a way that is easy to get backwards. Cancel is terminal: it announces the cancellation itself, and separately announces the run as complete (carrying the cancelled status), because the cancel signal is then set resolved, since it has been acted on, and anything that only listens for completion — a session closing out, a parent run waiting on this one — needs to hear that the run is over. Pause is not terminal: it announces only the pause, and nothing tells a completion listener the run has ended, because it has not. The signal a pause left behind stays exactly as it was, because that record is the same one a later resolution resumes against (INT-3).
All of this assumes a loop that is running. A paused run has no loop and no boundary coming, so a cancel sent to it is not left waiting for one: INT-25 ends the run at once.
Example
The same kind of poll, answered with a cancel and with a pause.
{ "status": "cancelled", "metadata": { "signal_id": "signal-1", "reason": "operator stopped the run" } }{ "status": "paused", "metadata": { "signal_id": "signal-1" } }Only the cancel is followed by a second, completion announcement; the pause produces exactly one.
A run that is only polling (PIPE-11) has no job in flight and no boundary coming, so there a signal takes effect at once.