Webhook Request and Session ID (Memory)
The TellFlow mobile application always sends a session_id when sending a chat message to the webhook. In your n8n workflow, you should use this value as the conversation memory key; this ensures that each chat session maintains its own history.
Webhook Payload (Mobile → n8n)
Every message sent to your webhook URL includes the following fields:
| Field | Type | Description |
|---|---|---|
session_id | string | Required. Session ID (UUID). Remains constant for the same chat session; new chat = new session_id. |
message | string | Message text entered by the user. |
tool / tool_name | string | Selected tool (optional). |
model | string | Selected model parameter (optional). |
file / audio | multipart | Included file or audio file (optional). |
Example (JSON):
{
"message": "Hello, what's the weather today?",
"session_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
When using FormData (with file/audio), session_id and message are sent in the same way.
Using session_id as Memory in n8n
- Extract
session_id(orbody.session_id) from the body in the webhook trigger. - Provide this value as the session / conversation / memory key in nodes that use conversation memory (AI Agent, Chat Model with memory, etc.).
- This ensures:
- Same
session_id→ Same chat history is used. - Different
session_id→ Different session, no overlap.
- Same
Example (n8n Expression)
- Session ID (Memory Key): Use
{{ $json.body.session_id }}or{{ $json.session_id }}(if the body is directly at the root) depending on your webhook node configuration. - Use this expression in the Chat Memory / Memory node or the AI Agent "Session Id" field.
Workflow Summary
- Webhook → Receives
body.session_idandbody.message. - Memory / Chat History → Session Id =
{{ $json.body.session_id }}. - AI / LLM → Generates a response using this memory; the response is written back to the same session.
This way, when a user starts a "new chat" in the app, a new session_id is generated, and a new conversation history begins in n8n.