Quick Overview
This workflow runs nightly on a staging n8n instance, finds published workflows with schedule or polling-style triggers that are not allow-listed by tag, and (optionally) deactivates them via the n8n API before sending a report to Slack.
How it works
- Runs every night at 02:00 on a Schedule trigger.
- Sets the allow-list tag name, instance label, dry-run mode, and whether to include polling triggers.
- Uses the n8n API to list all active (published) workflows on the instance.
- Filters out the current workflow and any workflows tagged with the allow-list tag, then keeps only workflows that have schedule/interval/cron triggers or polling configurations.
- If dry-run mode is disabled, deactivates each matching workflow via the n8n API.
- Builds a summary report of the workflows found (and unpublished if applicable) and posts it to a Slack channel.
Setup
- Create an n8n API key on the staging instance and configure an n8n API credential with the instance base URL (for example, https://staging.example.com/api/v1).
- Add a Slack credential, select the target Slack channel, and ensure the workflow can post messages there.
- Update the configuration values (allow-list tag, instance label, includePollingTriggers, and dryRun) to match your environment, and keep dryRun set to true until the report output looks correct.