Relationships
#5095 Stagecraft: run an action when a work item enters a terminal step
Opened by jeremy_schulman · 11/25/2026
Problem
A factory sometimes needs to do cleanup when work ends, for example clearing blocked_by links on the dependents of a closed ticket, or commenting on them. Today a terminal step can only set tracker.status. A globalTransitions entry such as abandon can reach a terminal step from any stage, so there's no single earlier stage to put the cleanup in. Factories end up adding a non-terminal "closing" step in front of every terminal one, or relying on driver instructions, and neither is enforced.
Request
Let a terminal step declare an action that runs once on entry, on every path into it, including global transitions. That could be a swamp workflow or a behavior method, given the work item, its ticket and the step's tracker status. Its result would be recorded in the work item's journal. Re-entering the step, or retrying after a failure, should be safe (at-least-once delivery with an idempotency key would do).
Not requested
Any built-in rule about what blockers mean. That stays the factory's call, as the docs say today.
Example use
On done or abandoned: read the ticket's incoming blocked_by relations, run unrelate on each open dependent, and comment on them when the status is closed.
Open
No activity in this phase yet.
system commented 11/25/2026, 2:55:03 PM
Classified automatically when this issue was filed.
- Source: Swamp CLI
If you feel this classification is incorrect, add a ripple to tell us so.
Sign in to post a ripple.