Clean up stale GitHub repos, branches and pull requests with GitHub API
Ready for 3.0Ready for 3.0. This template uses no nodes that n8n 3.0 removes. No removed nodes, versions or helpers found. Static check, last run 2026-12-01.
What this workflow does
This workflow has 23 nodes and runs on a schedule (every day). Along the way it connects GitHub.
How it runs
Trigger: On a schedule (every day).
- Get repositories for an organization (GitHub): work with organization
- is_archived (If): checks a condition and branches into true / false
- Get pull requests of a repository (GitHub): get pull requests (repository)
- Get Branches (HTTP Request): calls an HTTP API
- Updated (Date & Time): formats or calculates dates
- If: checks a condition and branches into true / false
- Not default (Filter): keeps only the items that match a condition
- If: checks a condition and branches into true / false
- Get PR Events (HTTP Request): calls an HTTP API
- Days Since Last Updated (Date & Time): formats or calculates dates
…plus 12 more steps. See the full node list below.
Services it uses
Before you upgrade to n8n 3.0
Nothing in this workflow is removed in n8n 3.0, so it should import and run after the upgrade.
Nodes used (6)
- Schedule Trigger
n8n-nodes-base.scheduleTrigger - GitHub
n8n-nodes-base.github - If
n8n-nodes-base.if - Date & Time
n8n-nodes-base.dateTime - HTTP Request
n8n-nodes-base.httpRequest - Filter
n8n-nodes-base.filter
From the author
Quick overview This workflow runs on a schedule to maintain a GitHub organization by labeling inactive pull requests as stale and closing them later, deleting old non-default branches, and archiving repositories that have been inactive for 90+ days. How it…