How can I send Slack messages via the n8n bot?

Describe the problem/error/question

I have a workflow that ends with sending a slack message. I am using OAuth for integration with Slack.

I’d like the message to be sent by the n8n app itself (the one that I give access to my Slack workspace). However, the workflow ends up sending the message with my account, which is not what I want.

I used a bot token before, but all that does is make a separate n8n app in my workspace, so there ends up being 2. I’d prefer if I only have the main n8n app in my workspace, and have that one send the messages.

How can I do this?

What is the error message (if any)?

N/A

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

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

Bumping this, wonder if anyone knows how to do this. Seems like it should be simple

Hello, bumping this again. Hoping the new rewards system motivates someone to help out here =)

Hi @sijobi2222, The only thing I can think of is * If using OAuth, ensure your app has the correct bot-level permissions:

  • chat:write → Allows sending messages as the bot.
  • chat:write.customize → Allows customizing the sender name/icon.
  • chat:write.public → Allows sending messages to public channels.
  • If the bot doesn’t have these scopes, it may default to sending messages from your user account instead.
1 Like

Thank you @Exnav29. Annoyingly, it doesn’t appear slack allows me to change the permissions of the app integrated with n8n, only a bot I make additionally.

It does appear it has permissions to write, though (see bottom of this image):

Hey @sijobi2222,

Can you please watch this video and see if you have done everything correctly?

Also, have you checked that you are using the Bot token instead of the User token?


.

:muscle: If my reply answers your question, please remember to mark it as a solution.

Thank you for the response @solomon. The issue for me isn’t that the bot isn’t sending, it’s that I can’t send it from the bot directly made via the n8n integration (i.e. the default bot - not a bot I make from scratch, as shown in the video).

I did make a bot as shown in the video, and it worked (with a bot token); however, with that solution I have two bots in my Slack for n8n: one which is the default for the n8n integration, the other being the additional one I made.

Below you will see the default one (above), and the custom one (below). Currently I can send a message from the one below using a bot token, the one above I cannot. I can also send a message from my own user using an OAuth.

I realize this is very picky of me, as I’m able to functionally use the app… but it just seems redundant to have to make a custom bot when there is already an n8n bot inside the Slack that apparently has write permissions, as per my previous post. That’s what I’m trying to figure out; is it possible to send messages via the default app?

I see. Would you be able to replace them?
Since the custom one works better than the default.

Maybe there’s a way of removing the default

2 Likes

Thanks man. It’s a bit annoying that I can’t get the default app to work with OAuth sending messages from itself, but your method works too.

I’m able to remove the default app from my workspace and use the bot one so that I’m only left with one.

Really appreciate the help.

1 Like

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