Archiving a Slack channel after 30 days (workflow)

Hello team,
I am trying to set up a workflow in n8n that would create a private channel based on a certain name format (channelname-yymmdd) and the next part would be to archive the channel after 30 days.
The first part (creation of public channel on a predefined name format) has been done, however I am having a hard time finding the right option for the archiving part - it works but with immediate archiving, not after 30 days.
I used the Slack node, however it does not have any option in there. At the same time I was trying with the HTTP node, POST directly on the channel - however in here I would need a specific Java command to trigger the command after 30 days.
Do you have any other suggestions or way out?
Thank you

Hey @GabCo,

Welcome to the community :tada:

What about using a schedule trigger that runs every day then use the Slack node to get a list of all channels and check if the name matches your pattern then extract the date to see if it is older than 30 days and if it is delete it.

Workflow below shows an example on how to do this and assumes your Slack app has permission to list all the channels.

hey @Jon ,

I am looking for a similar scenario to archive a slack channel based on a name, we are picking the channel name from Jira issue key. please provide a solution to match the name from jira issue key and proceed further to archive .

Note : as we cannot archive channel directly based on channel name , Currently I have pulled all the channels list from slack and I have the issue key from Jira which gives us channel name to match, please suggest on next step. Any help is really appreciated. I am really stuck with this since 2 days (I have a feeling this is rather very simple issue ) . Please help.

This is a little bit late but if anyone stumbles upon this thread here’s how I built the workflow to archive temporary channels based on their naming convention:

1 Like