Skip to content

Overlap is judged against the workflow's own unfinished runs

The overlap decision is made unattended, and a wrong answer is either a duplicated production run or a silently dropped one. The four policies are four genuinely different behaviours, and the buffer is a one-slot mailbox rather than a queue.

The rule

Normative: this is the rule
  1. Overlap MUST be decided against runs of the same workflow that have not reached a terminal state: pending, running or paused.
  2. A terminal run, and a run of any other workflow, MUST be ignored.
  3. With none active, every policy MUST proceed with the caller's trigger data unchanged.
  4. With one active, Skip MUST block the firing.
  5. With one active, Buffer MUST defer the firing and block it.
  6. With one active, Cancel MUST cancel every active run and announce each cancellation.
  7. With one active, Cancel MUST then proceed.
  8. With one active, Terminate MUST first cancel every job those runs still have outstanding, so no worker can pick one up after the run is gone.
  9. With one active, Terminate MUST then do what Cancel does.
  10. The buffer MUST hold at most one deferred firing per trigger.
  11. A second firing that arrives while one is buffered MUST be dropped, neither stacked nor overwriting the buffered one.
  12. A buffered firing MUST be released at the next firing once the run that blocked it is terminal or gone.
  13. On release, the buffered firing's own payload MUST replace the current firing's.
  14. A buffer whose blocking run can no longer be identified MUST be released rather than left stranded.
  15. A policy an implementation does not recognise MUST be treated as Skip, the only fail-safe direction, since every alternative destroys a running workflow.

What it means

The buffer is a mailbox with one slot, not a queue: a second firing that arrives while one is already held does not stack behind it and does not replace it — it is simply dropped, and the first firing's data is what the mailbox still holds. A reader expecting FIFO behaviour, or expecting the newest firing to win, gets neither.

Release carries the same surprise the other way. When the blocking run ends and the buffered firing is let through, it runs with the payload it was holding when it was deferred — not with whatever data the firing that triggered the release happened to carry. The current firing's own data is discarded; only the fact that something is now due survives from it.

Example

A run is active, one firing is buffered, and a second firing arrives before the first is released:

The buffer's trigger data after a second firing arrivesunchanged
{"n": 1}

Once the blocking run ends, the release carries the buffered firing's own data, not the payload of whatever firing caused the release:

What proceeds once the blocking run is gonebuffered
{"n": "buffered"}

The firing that triggered the release, which had carried {"n": "current"}, contributes nothing but the fact that it was time to check again.

Why

Recorded under OPEN-25.

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