n8n WhatsApp AI agent memory: which Session ID to use (and the one that merges every user)
Disclosure: I work on MemorySync (I'm Mohammed, the founder). I drafted this page with AI assistance and checked it against the source thread and the official docs listed under Sources on Oct 28, 2026. I read the threads and docs; I didn't run a WhatsApp workflow for this page. The question In the

Posted on Oct 28 • Originally published at memorysync.hashnode.dev
Disclosure: I work on MemorySync (I'm Mohammed, the founder). I drafted this page with AI assistance and checked it against the source thread and the official docs listed under Sources on Oct 28, 2026. I read the threads and docs; I didn't run a WhatsApp workflow for this page.
In the n8n forum thread "Simple memory issue" (Feb 3, 2026), a beginner building a WhatsApp companion bot got this on the Simple Memory node:
No session ID found Expected to find the session ID in an input field called 'sessionId' (this is what the chat trigger node outputs). To use something else, change the 'Session ID' parameter Enter fullscreen mode Exit fullscreen mode The only reply said that with a WhatsApp Trigger "you should reference a Session ID" and pointed to a screenshot. The thread closed automatically after 90 days with no accepted answer. An earlier thread, "Connect Simple Memory to WhatsApp Trigger error", shows the same failure and two different keys, and only one of them is right for a bot that talks to many people.
Status (checked Oct 28, 2026): both threads are closed (auto-closed 90 days after the last reply), neither has a marked solution.
Per n8n's Simple Memory common issues page, the sessionId is normally read from the On Chat Message trigger, and if you're not using that trigger "you'll need to manage sessions manually." The WhatsApp Trigger doesn't output a sessionId field, so the default "Connected Chat Trigger Node" setting finds nothing.
In Simple Memory (or Postgres/Redis Chat Memory), set Session ID to Define below and use the sender's WhatsApp ID. This is the expression the original poster in the second thread confirmed worked:
{{ $('WhatsApp Trigger').item.json.contacts.wa_id }} Enter fullscreen mode Exit fullscreen mode Per Meta's webhook payload reference, contacts[].wa_id is the customer's WhatsApp ID and messages[].from is the sender, so {{ $('WhatsApp Trigger').item.json.messages.from }} identifies the same person.
The other suggestion in that thread was {{ $node["WhatsApp Trigger"].json.metadata.phone_number_id }}. It clears the error, but per Meta's reference metadata.phone_number_id identifies your business number, not the person writing to it. Every contact then shares one session, so the bot mixes up what different people told it. For a companion bot that's the worst failure: it "remembers" one user's details in another user's chat.
n8n's docs make the same point about static keys: a fixed key like my_test_session is fine for testing, but set up real session management before publishing.
If you're on the Chat Trigger instead of WhatsApp, the same error is covered in n8n AI Agent memory per user.
Why does it work in the editor but not from WhatsApp? Usually because the test used a pinned or static session value. Live WhatsApp executions only carry what the trigger outputs, so the Session ID must be an expression on the trigger's data.
Should I use the phone number as the key? wa_id is the stable per-contact identifier WhatsApp gives you, which is what memory needs. It is also personal data, so treat the memory table accordingly.
Does the bot remember facts across weeks, or only the last messages? Chat Memory nodes keep a window of recent messages for that session. Remembering durable facts about a person (name, preferences) beyond that window needs a separate long-term memory step.
The MemorySync n8n guide documents a MemorySync Chat Memory sub-node for the AI Agent's Memory port, with a Session ID (your conversation key) and an End User ID (the person chatting). Every MemorySync operation is scoped by End User ID, and the guide says to use the same value across Add, Search and Recall. For WhatsApp, the same wa_id expression can fill both fields. MemorySync extracts durable facts from the user's turns, and those facts are shared with every other MemorySync surface for that user. It's community nodes from npm, so per the guide it needs a self-hosted n8n instance for now (n8n Cloud verification is in progress). I haven't tested it with the WhatsApp Trigger. Read the guide first. To see save and recall in your browser, try the MemorySync playground.