Report and clean up stale GitHub branches with Slack notifications
Quick Overview This workflow runs weekly (or manually) to scan GitHub repositories for merged-but-not-deleted and stale branches, then posts a cleanup report to Slack and can optionally auto-delete a capped number of branches. How it works 1. Runs on a weekly schedule or when you manually execute the workflow. 2. Loads configuration for the GitHub repo owner, repository list, stale age threshold, protected branch patterns, Slack channel, and deletion limits. 3. For each configured repository, fe
At a glance
Report and clean up stale GitHub branches with Slack notifications is a ready-made n8n workflow you import as a workflow JSON file — no build required. It connects Slack, GitHub. It's free to download. Follow the 5-step import below to go live in minutes.
- Platform
- n8n
- Connects
- Slack, GitHub
- Modules
- 14
- Price
- Free
- Version
- v1.0

About this workflow
Quick Overview This workflow runs weekly (or manually) to scan GitHub repositories for merged-but-not-deleted and stale branches, then posts a cleanup report to Slack and can optionally auto-delete a capped number of branches. How it works 1. Runs on a weekly schedule or when you manually execute the workflow. 2. Loads configuration for the GitHub repo owner, repository list, stale age threshold, protected branch patterns, Slack channel, and deletion limits. 3. For each configured repository, fetches all branches via the GitHub GraphQL API and fetches recently merged pull requests via the GitHub REST API. 4. Classifies branches as protected (skipped), merged-but-not-deleted, or stale based on last commit date and the configured stale-days threshold. 5. If auto-delete is enabled, deletes up to the configured maximum number of candidate branches in GitHub and compiles a success/failure summary. 6. Formats and posts the cleanup report to Slack, and if deletions ran, posts a second Slack message with the deletion results. Setup 1. Create and add GitHub credentials (fine-grained token or PAT) with access to list branches/PRs and permission to delete branches if you enable auto-delete. 2. Create and add a Slack credential with permission to post messages (chat:write) and set the target channel in the configuration. 3. Update the configuration values for repo owner, comma-separated repo list, staleDays, protectedBranches, reportOnly, and maxBranchesToDelete before activating the workflow.
How to import this n8n workflow
- 1
Download the workflow JSON file after purchase.
- 2
Open n8n → click the menu → Import from File.
- 3
Select the downloaded JSON and import.
- 4
Set up credentials for each node that requires them.
- 5
Click Execute Workflow to test, then activate.
Setup guide
Setup guide included
Purchase to unlock the full step-by-step guide
Related N8n workflows
Add new GetResponse contacts to Zoho CRM (if the contact already exists in Zoho CRM, send a message in Slack instead of adding the contact to Zoho CRM)
Send Slack for new mail campaign in CleverReach
Create script-to-video avatar videos with GPT-4.1-mini, HeyGen, Google Drive, Gmail and Slack
Create a Revolut Business draft payment and send a Slack notification from a new WooCommerce order
Cold outreach automation: Scrape local leads with Dumpling AI & call via Vapi
Send Slack messages for new Harvest invoices
Generate weekly supply chain OTIF reports and AI analysis with Notion and GPT-4o
Import products from Google Sheets to Shopify with multi-variant support
Reviews
No reviews yet
Be the first to buy and share your experience.
Leave a review
Sign in to share your experience with this workflow.
Create a free account to purchase workflows.
- JSON blueprint — instant download
- Setup guide PDF included
- 5 downloads · valid 30 days
- Works with n8n
Need help setting this up?
Book a 3-hour live setup session with an Agility consultant.
- Configure live on Google Meet / Zoom
- Free follow-up if workflow has defects
- Platform expert assigned to you