Slack Message Post not handling markdown

Describe the problem/error/question

I have an LLM generating a response in Markdown format. I’m using the Slack node to post a message. I have tried both, Simple Text and specifying Markdown in the options (see screenshot) I have also tried specifying a block structure to use (and it does not use it, it just inserts the “Notification Text” in the same format as the Simple Message). The type is always “text”, but when I specify Markdown is should change the type to “mrkdwn” shouldn’t it?

Information on your n8n setup

  • n8n version: version 1.88.0
  • Database (default: SQLite): None
  • n8n EXECUTIONS_PROCESS setting (default: own, main): No changes here, whatever cloud sets up
  • Running n8n via (Docker, npm, n8n cloud, desktop app): n8n Cloud
  • Operating system: Mac

Hello and welcome to the community!

Slack supports their own flavor of markdown.

Details

You need to replace ** with *, and - at the beginning of lines with * for proper bullet-points.

This can be done by variable.replace(/^- /gm, "* ").replaceAll("**", "*")

If the above resolves your question, please mark this post as a :white_check_mark: Solution.

3 Likes

That does work, additionally I have added much more stringent rules in my prompt about output formatting. Sometimes it works, sometimes it doesn’t as it goes with LLMs. Thanks for the response.

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