Skip to content

Add unused-workflow discovery and definition delete - #1

Draft
ElliotPadfield wants to merge 1 commit into
mainfrom
cursor/unused-hatchet-workflows-1fd8
Draft

Add unused-workflow discovery and definition delete#1
ElliotPadfield wants to merge 1 commit into
mainfrom
cursor/unused-hatchet-workflows-1fd8

Conversation

@ElliotPadfield

Copy link
Copy Markdown
Owner

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_workflows lists definitions with no runs in a lookback window (default 30 days). Each definition is probed with limit=1 so a busy tenant cannot hide a still-active workflow behind a truncated run scan.
  • get_workflow fetches one definition by id.
  • delete_workflow permanently deletes a definition (not a run) via DELETE /api/v1/workflows/{id}. Requires confirm: true. Also drops cron schedules on that definition.
  • list_workflows now accepts optional name and offset.

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-549
  • pipeline-status — manual ops trigger, no cron

Live dashboard delete still needs a HATCHET_CLIENT_TOKEN against the influship tenant.

Test plan

  • pnpm test (48 tests)
  • pnpm typecheck
  • After merge: npx hatchet-mcp with a real token → find_unused_workflows then delete_workflow for confirmed-dead ids

Linear Issue: INF-525

Open in Web Open in Cursor 

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>
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants