Slack Trigger cannot be executed in Socket Mode

Hi.

I am trying to connect Slack with n8n using Socket Mode.
I’ve correctly set up the Slack API, n8n, and Slack App, but the Slack Trigger doesn’t execute when a message is posted to Slack.

There is no specific error message, but Slack events are not being received in n8n.

Question

  1. Is it even possible to execute a Slack Trigger in Socket Mode?
  2. Has anyone successfully implemented it in Socket Mode?

Environment of n8n

  • n8n version: 1.94.1
  • Database: SQLite(default)
  • n8n EXECUTIONS_PROCESS setting: main(default)
  • Running n8n via: Docker in local PC
  • Operating system: Windows 11 Pro

Thank you.

1 Like

just making sure, you’re hosting n8n in your local PC, does the ip address is still localhost, or you already forward it to something like ngrok to make it https

because if it’s still localhost, you cannot connect to any external services as far as i know

Thank you for youre response.

Running n8n: Docker on local PC
As mentioned above, n8n is hosted on the my local PC.
The IP address remains localhost and is not forwarded to ngrok, etc.
As I understand it, if we use Socket Mode, we do not need to forward it to ngrok, etc.

So that I understand, the n8n Slack Trigger node connecting is the Slack server via WebSocket.

Is my understand incorrect above?

The following operations are also successful.

  • Post a message to Slack
  • The following code returns the result “WebSocket connected successfully”.
const WebSocket = require('ws');
const token = process.env.SLACK_SOCKET_MODE_TOKEN;
if (!token) {
  console.error('It not setting is SLACK_SOCKET_MODE_TOKEN');
  process.exit(1);
}
const url = 'wss://wss-primary.slack.com/?token=' + token;
const socket = new WebSocket(url);
socket.on('open', () => {
  console.log('WebSocket connected successfully');
  socket.close();
  process.exit(0);
});
socket.on('error', (err) => {
  console.error('WebSocket error:', err);
  process.exit(1);
});

Thank you.

Hi there

Even though you’re using Socket Mode, n8n’s built-in Slack Trigger node doesn’t support Socket Mode yet. Instead, it relies on the traditional Slack Events API, which sends HTTP POST requests to a public webhook URL that Slack can reach.

Since your n8n instance is running locally (on localhost) and not exposed to the internet, Slack can’t deliver events to the required webhook — so the trigger never fires.

Why posting messages to Slack works:

Sending messages uses Slack’s Web API, which makes outbound HTTP calls — no public URL needed for that. That’s why this part works fine, even locally.

2 Likes

Thank you for your response.

I understood that the n8n Slack Trigger node does not support Slack’s Socket Mode on latest.

Are there plans to support Socket Mode of Slack in the n8n Slack Trigger node?
If the planed, when it will be released?

If you know, please let me know.

Thank you.

2 Likes