Slack Trigger Session Id is missing

Hello everyone.

This is my first post here and I hope you can help me out.

I would like to build a slack Q&A agent.
The bot should memorize conversations and also search and answer important documents.

İ wanted to use postgres memory and this node needs a session id. but slack does not offer mapping with session id.

{{ $json.sessionId }}

Only if I use the normal chat trigger is postgres recognized.
Any ideas how to get the session id from slack?



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:

Hey @Cetryn,

You can use almost anything as the session_id. Here are a few options:

  • username
  • A combination of the username and channel ID

Since sessions are temporary, you can automatically delete inactive ones after a certain period.

Or you could change the session ID after the user becomes inactive. This way, old sessions remain in the database while avoiding conflicts with future interactions from the same user.

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

This basically worked for me. I just had to change “session ID” from “Connected Chat Triggers” to “Define Below” and set the key to be the Timestamp from Slack. I could have used the username as well, I just want it to unique everytime so I went with Timestamp

Yeah, this works but doesn’t keep a memory.

To be able to retrieve previous messages you have to use the same session_id until that chat session ends.

You can either reuse that timestamp or create a custom ID