How to get slack trigger to work by sending a direct message to the bot in slack

Hey, I am just starting with n8n and experimenting with the slack trigger.

I have followed previous guides and have gotten my trigger working with “any event”, however how would I go about setting it up so that it only triggers when someone sends a direct message to the bot

hello @Tarik_A

Use the option “Bot / App Mention” or add an IF/switch node to filter out unrelated messages

1 Like

Thank you for the advice, when I use the Bot / App Mention it does not pick up Direct messages to the bot. I will give the filter node a go to try filter out messages. :slight_smile:

1 Like

Thank you, I used the If filter, and filtered to channel_type = im, which worked. I appreciate the help!

2 Likes

@Tarik_A same for me, selecting “Bot / App Mention” does not trigger on direct messages to the bot.

Selecting “Any” as trigger is not an option since we have a workspace with many hundred messages per day.

@barn4k Is there any alternative to trigger a workflow? Maybe by not using the built-in slack trigger but having a custom webhook trigger it?

@Shifting0425 This might not be a viable or long-term solution, but I revoked the permissions on my bot in the Slack settings so that it can only access DM’s, to minimise the events from selecting “Any”.

Ideally, N8N will still be able to provide the correct way of implementing “Bot / App Mention”

You can set a usual Webhook node and configure your bot to listen for specific events.