Archive Empty Public Slack Channel
We have a lot of empty channels in our Slack instance and we want an automatic way to keep it clean and uncluttered.
This Workflow will trigger once the ‘Empty Public Channels’ alert has exceeded its threshold. A warning message will be sent to the empty public channel via Slack which will allow any new channel members to contact their Admin Slack channel (#it-team) within a 30 day window before proceeding with automatically archiving the channel. A Slack message will also be sent to the IT Team before the 30 days and after the channel as been archived.
1. ‘Empty Public Channels’ Slack Alert
The desired threshold of the ‘Empty Public Channels’ system Alert will need to be configured in the Alerts Manager section of the platform prior to creating your Workflow. In our example below, we have the alert enabled with a threshold set to 0.
2. Send Slack Channel Message
First, use the Workflow to target the Slack channel that will be notified by message once the ‘Empty Public Channels’ alert has been triggered.
- This action will be used as a warning message to alert the channel of the scheduled archive.
- If someone joins the channel within the 30 day window, they will see the notification for the scheduled archive and know to contact their Admin to stop the channel from being deleted.
Then select the “Send Slack Channel Message” action to notify the IT Team of the empty channel.
3. Wait for ‘30’ Days
Use the ‘Wait for Duration’ action to pause your Workflow and allow any members who joined the channel to reach out to the admins about the targeted Slack channel.
In the event a member contacts the #it-team Slack channel and requests that the channel not be deleted, the ‘Wait for Duration’ action gives the admin the option to stop the Workflow and refrain from automatically archiving the Slack channel.
4. Archive Channel
After the 30 days have passed, and no Slack channel members have contacted the IT Admins, archive the empty channel to remove it from your Slack environment.
5. Send Slack Channel Message
Lastly, after the 30 days have passed, send the IT Team one final message notifying them of the empty channel removal.
BetterCloud Reference Articles
- How to Create a Workflow
- Using an Alert as a Workflow Event
- Slack Alerts in BetterCloud
- Wait for Duration
- Slack Events, Conditions, and Actions in Workflows