A workflow is written in the ADL file as a trigger and steps. The server runs it when the trigger happens; there is no handler code behind it.
Retiring an instrument cancels every run still planned on it: those runs can never start. Runs on it that are running or finished, and every run on another instrument, are left alone.
When a instrument has a transition:
query('run', { instrument: 'adl.ledger.ledger.instrument:' + $trigger.record.id, status: 'planned' }), cancelPlannedRun: transition cancel run