tomgranot/hubspot-admin-skills/cleanup-workflows
Claude Code and agent skill by tomgranot/hubspot-admin-skills
- community
Checking that the SKILL.md file is still in the repository.
Audit and remove inactive, test, or deprecated workflows from HubSpot. Identifies workflows that have never enrolled contacts, workflows turned off for 90+ days, and test workflows.
Install
npx vskill@latest install tomgranot/hubspot-admin-skills/cleanup-workflowsSKILL.md
Cleanup Workflows
Audit HubSpot workflows to remove dead weight. Unused workflows clutter the automation dashboard and make it harder to understand what is actually running.
Prerequisites
- A HubSpot service key (
HUBSPOT_ACCESS_TOKENin.env; an existing legacy private app token also works) with theautomationscope - Python 3.10+ with `uv`
- Note: The Automation API may return 403 on some plan tiers. If so, audit manually in HubSpot UI under Automation > Workflows.
- Strongly recommended: run
/workflows-as-codefirst to export a JSON backup of every workflow — deleted workflows cannot be restored, but an export lets you recreate them via the API.
Step-by-Step Instructions
Stage 1: Plan
Confirm with the user before starting:
- Archive-first policy: turn off, wait a week, then delete (recommended)?
- Any workflows that must never be touched (compliance, integrations)?
Stage 2: Before
Inventory all workflows via the v4 Automation API:
For each workflow, record: flow ID, name, enabled status, type, created date, last updated date. Enrollment counts are visible in the UI (Automation > Workflows > Details).
Stage 3: Execute
Flag workflows matching any of these criteria:
- Turned off for 90+ days with no plans to reactivate
- Zero enrollments ever (likely test or abandoned drafts)
- Test workflows (names containing "test", "temp", "copy of", "draft")
- Superseded workflows replaced by newer versions
- Error state workflows that have been failing consistently
Before deleting, check:
- Does the workflow feed into another workflow (via enrollment trigger or go-to-workflow action)?
- Does the workflow set properties that other workflows depend on?
- Is there any documentation referencing this workflow?
Present the candidate list to the user and wait for explicit confirmation. Then, for confirmed candidates: turn each workflow off first (in the UI, or PUT /automation/v4/flows/{flowId} with isEnabled: false — the PUT requires the current revisionId), wait one week, then delete via DELETE /automation/v4/flows/{flowId} or the UI.
Stage 4: After
- Re-run the inventory and confirm the deleted workflows are gone.
- Document deleted workflows in a cleanup log (name, purpose, reason for deletion).
- Notify workflow owners.
Rollback
- Deleted workflows cannot be restored in HubSpot.
- A
/workflows-as-codeexport taken beforehand contains each workflow's full JSON definition — recreate a deleted workflow withPOST /automation/v4/flowsfrom its export. - HubSpot retains workflow activity history on contact records even after the workflow is deleted.
Tips
- Use folders in the workflows dashboard to organize by team, purpose, or status.
- Prefix draft/test workflows with "[TEST]" so they are easy to identify later.
- Review workflows quarterly as part of the database cleanup routine.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cleanup-workflows/SKILL.md
Popularity
- Repository stars
- 56
- Repository forks
- 15
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tomgranot/hubspot-admin-skills/cleanup-workflows)