Setting up Slack Bot Trigger on anyevent Issue in Private slackbot DMs

Hey everyone,

I’m running into an issue with a Slack bot I’m working on. Currently, the bot is using the Slack Trigger set to watch the whole WorkSpace and triggers on anyevent. We set it up this way because we want users to be able to interact with the bot in a private DM with the slack bot without needing to @mention the bot for every response. And we later filter for only @mentions in channels that or not DMs.

The problem is, using anyevent like this is eating up all our executions since it triggers on literally everything across all channels. What I’m trying to figure out is how to restrict the watch space to only be for private DMs with the bot so that we can trigger on anyevent there. it’s fine if we need to set up a separate workflow for DMs.

Does anyone know how to handle this without sacrificing the private DM functionality? Any tips, or other approaches would be super helpful. Thanks!

2 Likes

It looks like your topic is missing some important information. Could you provide the following if applicable.

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

Same problem.

Same thing here - we want our users to only interact with the bot in private.

It’s an HR bot, so the conversations are better kept private.

I believe this is a common use case.

Similar issue here - Ive got slack connected to trigger the input events but filtered for @mentions, I’m unable to figure out a way to also enable direct messaging.

Here is a walk around, triggering when new message is posted in the private channel.
From n8n, there is a “New Message Posted to Channel”, which is used to trigger event when receiving new msg.
From Slack, Event Subscriptions → Subscribe to bot events → message.groups. This event trigger give permission to above trigger.
Then you can create a private channel that only contains you and the bot, then you can do new message to trigger the event.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.