Can Slack work with multiple workspaces?

I have slack workflow which works well for one workspace. Slack node are also splited by channels I can overcome this by storing channels ID in database. But what about different workspace I think we need another pair of credentials for that. I we can’t make credentials as expression.

I tried to use webhook but slack event subscription doesn’t except that URL.

Do you have any ideas?

Information on your n8n setup

  • n8n version: 2.0.3
  • Database (default: SQLite): postgres
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker
  • Operating system: ubuntu

Hi @Kateryna_Kravchuk, what exactly is your use case for connecting to multiple workspaces? I believe slack requires a new dev app to be created per workspace which will require separate access tokens for each workspace. You can however use http nodes and the events api with a webhook, however I see you have tried that. Was there any specific error when you say it didnt accept your webhook url?

I want to save slack access token from each workspace to database and pass it to Credentials to connect with as expression. Yes, slack didn’t accept webhook url with error: New Request URL

Your URL didn’t respond with the value of the challenge parameter.

Slack doesn’t accept the webhook URL because, during verification, it expects your endpoint to echo back the challenge value it sends in the request body. If your endpoint doesn’t respond with that exact value, Slack gonna rejects it with that error.

To fix this, your webhook endpoint must handle Slack’s URL verification like this:

**•	Read** challenge **from the incoming request**

**•	Respond with** { "challenge": "<received_challenge>" }

**•	Return HTTP 200**

Once the URL is verified, Slack will start sending real events.

You will need to setup a new credential for every workspace you want to receive events on. You could then either have a separate workflow for each event trigger or a single workflow with all event triggers for each workspace and then route to the correct reusable workflows.

The problem with trying to do this in a custom manner where you’re trying to pass workspace credentials, is that you wont be able to auth and listen to events without having the credentials pre-setup