Back to Skills

cleanup-workflows

TomGranot
Updated 2 days ago
2 views
33
11
33
View on GitHub
Testingtestingautomation

About

This skill audits and removes inactive HubSpot workflows to clean up your automation dashboard. It identifies workflows that have never enrolled contacts, have been turned off for 90+ days, or are marked as tests. Use it for ongoing maintenance to declutter and simplify your workflow management.

Quick Install

Claude Code

Recommended
Primary
npx skills add TomGranot/hubspot-admin-skills -a claude-code
Plugin CommandAlternative
/plugin add https://github.com/TomGranot/hubspot-admin-skills
Git CloneAlternative
git clone https://github.com/TomGranot/hubspot-admin-skills.git ~/.claude/skills/cleanup-workflows

Copy and paste this command in Claude Code to install this skill

Documentation

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

  • HubSpot API token in .env
  • Python with hubspot-api-client installed via uv
  • Note: The Workflows API may return 403 on some plan tiers. If so, audit manually in HubSpot UI under Automation > Workflows.

Step-by-Step Instructions

Stage 1: Before — Inventory All Workflows

Pull all workflows. The Automation API endpoint for workflows:

import requests

headers = {"Authorization": f"Bearer {os.getenv('HUBSPOT_API_TOKEN')}"}
response = requests.get(
    "https://api.hubapi.com/automation/v4/flows",
    headers=headers,
    params={"limit": 100}
)
workflows = response.json()

For each workflow, record: ID, name, enabled status, type, enrollment count, created date, last updated date.

Stage 2: Execute — Identify Candidates for Deletion

Flag workflows matching any of these criteria:

  1. Turned off for 90+ days with no plans to reactivate
  2. Zero enrollments ever (likely test or abandoned drafts)
  3. Test workflows (names containing "test", "temp", "copy of", "draft")
  4. Superseded workflows replaced by newer versions
  5. Error state workflows that have been failing consistently

Before deleting, check:

  • Does the workflow feed into another workflow (via enrollment trigger)?
  • Does the workflow set properties that other workflows depend on?
  • Is there any documentation referencing this workflow?

Stage 3: After — Delete and Document

  1. Turn off workflows first, wait one week, then delete if no issues arise.
  2. Document deleted workflows in a cleanup log (name, purpose, reason for deletion).
  3. Notify workflow owners before deletion.

Stage 4: Rollback

  • Deleted workflows cannot be restored.
  • Before deleting, screenshot or document the workflow logic (triggers, actions, branches) so it can be recreated if needed.
  • 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.

GitHub Repository

TomGranot/hubspot-admin-skills
Path: skills/cleanup-workflows
0

Related Skills

evaluating-llms-harness

Testing

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

View skill

cloudflare-cron-triggers

Testing

This skill provides comprehensive knowledge for implementing Cloudflare Cron Triggers to schedule Workers using cron expressions. It covers setting up periodic tasks, maintenance jobs, and automated workflows while handling common issues like invalid cron expressions and timezone problems. Developers can use it for configuring scheduled handlers, testing cron triggers, and integrating with Workflows and Green Compute.

View skill

webapp-testing

Testing

This Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.

View skill

finishing-a-development-branch

Testing

This skill helps developers complete finished work by verifying tests pass and then presenting structured integration options. It guides the workflow for merging, creating PRs, or cleaning up branches after implementation is done. Use it when your code is ready and tested to systematically finalize the development process.

View skill