Add unused-workflow discovery and definition delete - #1
Draft
ElliotPadfield wants to merge 1 commit into
Draft
Conversation
INF-525 needs a way to find Hatchet workflow definitions with no recent runs and remove them from the tenant. Add find_unused_workflows, get_workflow, and a confirm-gated delete_workflow, plus name/offset filters on list_workflows. Co-authored-by: Elliot Padfield <ElliotPadfield@users.noreply.github.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
INF-525 is to clean up unused Hatchet workflow definitions that linger in a tenant after code is renamed or retired. This release gives the MCP the tools to do that safely.
find_unused_workflowslists definitions with no runs in a lookback window (default 30 days). Each definition is probed withlimit=1so a busy tenant cannot hide a still-active workflow behind a truncated run scan.get_workflowfetches one definition by id.delete_workflowpermanently deletes a definition (not a run) viaDELETE /api/v1/workflows/{id}. Requiresconfirm: true. Also drops cron schedules on that definition.list_workflowsnow accepts optionalnameandoffset.Influship tenant (code audit)
Workers still register these unused Hatchet workflows in
Influship/influship:analyze-posts/analyze-creator— cron already removed; comments say they were kept for manual refresh until Phase 9 (≥14 days after analyze-batch). That window has long passed. Full source removal is INF-489.Do not delete as part of this ticket:
refresh-pipeline-stats— owned by INF-549pipeline-status— manual ops trigger, no cronLive dashboard delete still needs a
HATCHET_CLIENT_TOKENagainst the influship tenant.Test plan
pnpm test(48 tests)pnpm typechecknpx hatchet-mcpwith a real token →find_unused_workflowsthendelete_workflowfor confirmed-dead idsLinear Issue: INF-525