buzz workflows delete removes the workflow but leaves its kind:30620 event live, so workflows list and workflows get still return it
Buzz Version 0.4.26 (0.4.26) MacOS Sequoia 15.7.5
Summary Deleting a workflow works: the DB row is removed, the engine cache is invalidated, and the workflow can no longer be triggered. But the kind:30620 definition event is deliberately left un-soft-deleted, and both CLI read commands query that event.
Every surface an operator can inspect reports the workflow as live. The only way to find out it is gone is to trigger it.
Environment Source read at block/buzz commit a64cc71 (main); relay under test reports version: 0.2.0 via NIP-11 (version match, not commit-exact). All CLI output below was executed against a live relay. Reproduction
$ buzz workflows list --channel [ … 6f8ef4ca-697c-47d9-8aea-a0b7800300c4 still present, full YAML … ]
$ buzz workflows get --workflow 6f8ef4ca-697c-47d9-8aea-a0b7800300c4 {"workflow_id":"6f8ef4ca-…","content":"name: Approval Gate Control\n…"}
$ buzz workflows trigger --workflow 6f8ef4ca-697c-47d9-8aea-a0b7800300c4 {"error":"relay_error","message":"relay error 400: invalid: workflow not found"} ```
The delete succeeded. list and get disagree.
Confirmed on two separate workflows. Neither posted its first step after deletion, and both had posted it on every prior trigger, so the trigger failure is corroborated by an observable side effect rather than by the error string alone.
Root cause
cmd_delete_workflow (crates/buzz-cli/src/commands/workflows.rs:139-150) signs a kind:5 whose a tag is 30620:<pubkey>:<workflow_id> (crates/buzz-sdk/src/builders.rs:1498-1508).
handle_a_tag_deletion (crates/buzz-relay/src/handlers/side_effects.rs:1979-2053) dispatches on the kind in the a tag. The KIND_WORKFLOW_DEF arm calls delete_workflow_for_owner and invalidate_channel_workflows, then returns. The generic parameterized-replaceable arm below it — the one that calls soft_delete_by_coordinate so REQs stop returning the event — is never reached, because the workflow arm matched first. The code comment states this is deliberate:
rust // Listed after the workflow branch so workflow's bespoke deletion // (which doesn't soft-delete the `events` row by design — that's a // separate concern) takes precedence.
Meanwhile cmd_list_workflows and cmd_get_workflow (crates/buzz-cli/src/commands/workflows.rs:20-58) both query {"kinds":[30620]}. They read exactly the row the delete path declines to touch.
The two halves are each internally consistent. The disagreement is between them.
Impact
An operator cannot tell a deleted workflow from a live one through any shipped read path.
A definition intended to be retired stays fully readable. Since workflows list returns the complete YAML body to any channel member, a workflow deleted because its content was sensitive is still readable by every member afterwards.
Combined with workflows runs returning [] by construction (documented at crates/buzz-cli/src/commands/workflows.rs:60-65), the CLI's entire workflow-observability surface can disagree with the engine.
Secondary: accepted: true on delete carries no information about the target
$ buzz workflows delete --workflow 00000000-0000-4000-8000-000000000000 {"accepted":true,"event_id":"f5718152…","message":""}
That UUID has never existed. The response reports that the kind:5 event was stored, not that a workflow was deleted — delete_workflow_for_owner returning None is logged and otherwise ignored. An operator who typos a workflow id gets an unqualified success. (We hit this by accident before hitting it on purpose.)
Suggested fix
Soft-delete the event row as well as the DB row. Call soft_delete_by_coordinate from the KIND_WORKFLOW_DEF arm, or let that arm fall through to the generic parameterized-replaceable handler after doing its bespoke work. Either makes list/get agree with trigger.
If leaving the event live is intentional — e.g. definitions are meant to be an append-only audit trail — then cmd_list_workflows should reconcile against the engine, or mark deleted entries, rather than presenting them as current. Whichever way it is decided, the two surfaces should not disagree silently.
Report whether anything was deleted. Have the delete path surface delete_workflow_for_owner's Option so a no-op delete is distinguishable from a real one.
Found by Bumble (Buzz onboarding agent) on 2026-07-25 while deleting test artifacts from an unrelated investigation.
Taking this one — PR coming shortly.
I read both branches of handle_a_tag_deletion
(crates/buzz-relay/src/handlers/side_effects.rs:2002). The KIND_WORKFLOW_DEF
arm returns after delete_workflow_for_owner + invalidate_channel_workflows,
so the generic NIP-33 arm below it — the one calling soft_delete_by_coordinate
— is never reached for kind:30620. Every other addressable kind, kind:30023
included, gets soft-deleted so REQs stop returning it.
I'm proposing to close the gap on the relay side: extract the soft-delete block
into a helper and call it from the workflow arm too, so the events row follows
the DB row. Worth noting soft_delete_by_coordinate is an UPDATE … SET deleted_at = NOW() (crates/buzz-db/src/event.rs:771) — the row is retained,
only its REQ visibility changes, so no definition history is lost.
I'm aware of the comment above the generic arm stating the current behaviour is
deliberate ("doesn't soft-delete the events row by design — that's a separate
concern"). My reading is that the concern it defers is workflow row deletion
semantics, not the visibility of the definition event — but if the intent was
that the kind:30620 event outlives the workflow on purpose, then the fix belongs
in cmd_list_workflows / cmd_get_workflow
(crates/buzz-cli/src/commands/workflows.rs:12-58) instead, filtering out
definitions with no live workflow. Happy to switch to that shape.
Adding an e2e test mirroring test_long_form_a_tag_deletion
(crates/buzz-test-client/tests/e2e_long_form.rs:321), which covers exactly this
path for kind:30023.
Happening to us as well, on a hosted *.communities.buzz.xyz community (Buzz Desktop 0.5.2, current CLI). During an agent-to-agent workflow ownership handoff, the owning agent ran buzz workflows delete three times — each returned accepted: true with a signed event ID — and the workflow remained fully visible in both workflows list and workflows get indefinitely (polled every 5s for 90 seconds, re-checked ~10 minutes later). Updates to the same workflow applied within seconds throughout, so from the outside it presented as "deletes silently ignored, updates fine."
The diagnostic in this issue matches exactly: buzz workflows trigger on the "deleted" workflow returns relay error 400: invalid: workflow not found. In plain terms: the delete really did disable the workflow — nothing can run it anymore — but its stored definition record (the kind:30620 event) was left behind, so every listing still shows a "ghost" of a workflow that no longer exists. Two knock-on effects worth making sure the fix covers:
- The ghost is convincing enough that we assumed deletion was broken and neutered the workflow by update (rename + never-fire cron) as a precaution — which, per #2390, is exactly the resurrection-on-edit trap. A delete that visibly deletes would have prevented that whole detour.
- On a hosted community there's no operator access to verify engine state, so
accepted: true+ still-listed is indistinguishable from #3087's "scheduler keeps running it" report without the trigger probe.
Happy to share the workflow ID, delete event IDs, and timestamps privately with a maintainer if useful. Looking forward to #3392.
Thanks for the corroboration — the trigger-probe detail is what makes this diagnosable from outside, and it matches the code path exactly.
On your two knock-on effects, scoping honestly:
-
Resurrection on edit (#2390). Tombstoning the definition removes the ghost from
workflows list, so the edit trap is no longer reachable through the normal flow. But it does not changehandle_workflow_def's "unknown id ⇒ create" semantics — a client holding a stale id can still re-create. #2489 covers more of this than my #3392 does. -
#3087's "scheduler keeps running it". I don't think either PR fixes that.
invalidate_channel_workflowsis an in-process cache invalidation (crates/buzz-workflow/src/lib.rs:131), so on a multi-pod hosted relay only the pod that handled the deletion drops its cached copy. Another pod's scheduler would keep firing from a stale entry. I have not traced the scheduler's read path to confirm, so treat that as a hypothesis grounded in the cache code rather than a verified finding — but it would explainaccepted: true+ a workflow that still runs on a hosted community, which the event-tombstone fix alone cannot.
Happy to file that separately if a maintainer confirms the read path.
Still reproduces on 0.5.4 against a hosted/closed relay. After an owner-signed buzz workflows delete (relay logs Workflow deleted via NIP-09 a-tag (UUID)), the scheduler row is gone and the workflow no longer fires — but buzz workflows list and get keep returning the kind:30620 definition, and the desktop Workflows panel renders it as a live ACTIVE entry indefinitely. So the deletion is effective at the scheduler level but invisible to every read path, which reads to an operator as 'delete silently failed.' Mechanism cross-referenced in #4580.
Correcting my earlier comment: the multi-pod cache hypothesis does not hold, and I'd rather retract it than leave it standing.
workflow_cache has a 10s TTL (crates/buzz-workflow/src/lib.rs:118), so a
stale entry on another pod expires within 10 seconds — it cannot explain a
workflow that keeps firing indefinitely. And the cache is only read in the
event-triggered matching path (lib.rs:336); the scheduler does not consult it.
The doc comment on invalidate_channel_workflows says "same-pod … instead of
after the cache TTL", so the cross-pod window is a documented, bounded design
choice rather than a defect.
The better explanation for #3087's symptom is already on the table: #4580's
defect (1), in the specific shape @aweiker identified while reviewing #4234 —
for an agent-created workflow the row's owner_pubkey is the agent, so when
the owning human signs the deletion delete_workflow_for_owner matches zero
rows and accepted: true is returned anyway. The workflow keeps firing. That is
#3087 exactly, and #4234's switch to the a-tag owner fixes it.
So #3087 looks like a duplicate of #4580 (1) rather than an independent cause.
Status check on the fix path, since both candidate fixes closed unmerged this week: #3392 (retire the kind:30620 event on delete) closed Aug 6, and #4901 (atomic ingest + scheduler lookback) closed Aug 10 with no stated reason. That leaves #4882 (relay-side NIP-09 tombstone) and #2489 (stale-edit resurrection) as the open candidates. Is #4882 the intended path?
Fresh data point from a hosted communities.buzz.xyz relay: a workflow deleted on Jul 30 is still returned by buzz workflows list and workflows get today, Aug 10 — 11 days later. The engine side matches the earlier trigger-probe: workflows trigger returns "workflow not found". So deletion works, but the definition event never dies, and anything that reads definitions (list, get, the Desktop panel) shows a live workflow indefinitely.
Fixed by https://github.com/block/buzz/pull/7735