How to: Conversational Chat in Slack n8n

Hi I was struggling to get this to work because Slack handles messages and threads weirdly, so I wanted to make a post about how to get conversational chat (talk back to the AI with context of previous message) to work with slack.

  • Receive a message on Slack
  • Immediately reply to it (using options select reply to message and specify the ts)
  • When it gets to the agent node, add memory and set the session key to `thread_ts` from the message you replied with

We pretty much just need to reply to the initial message so it creates a thread and can get the thread timestamp which will be linked to any following message within the thread.

Hope this helps.