Overview
The Symbiosika Chat Session Store node manages chat sessions by storing, retrieving, and deleting session data identified by unique session IDs. It is useful in scenarios where you need to maintain state or context across multiple interactions in a chat application, such as tracking user conversations or managing session lifetimes.
Practical examples include:
- Storing a chat session ID with an associated chat identifier when a new conversation starts.
- Retrieving session details to continue a conversation within a valid time window.
- Deleting expired or unwanted sessions to free up resources.
Properties
| Name | Meaning |
|---|---|
| Operation | The action to perform: Store Session, Get Session, or Delete Session. |
| Session ID | A unique identifier for the chat session. |
| Chat ID | The chat identifier to associate with the session (required only when storing a session). |
| Session Duration (Minutes) | How long a session remains valid after last use, in minutes (used when storing or getting a session). |
Output
The node outputs JSON objects that extend the input data with operation results:
- For Store Session:
operation:"stored"chatId: The stored chat ID
- For Get Session:
operation: One of"retrieved","expired", or"not_found"chatId: The chat ID if retrieved successfullylastUsed: Timestamp of the last access (when retrieved)valid: Boolean indicating if the session is still valid
- For Delete Session:
operation:"deleted"existed: Boolean indicating if the session existed before deletion
No binary data output is produced by this node.
Dependencies
- This node uses an internal in-memory Map object to store session data during runtime.
- No external services or API keys are required.
- Sessions are ephemeral and will not persist beyond the lifetime of the node execution environment.
Troubleshooting
- Missing Session ID: The node requires a session ID for all operations. If omitted, it throws an error "No session ID provided".
- Missing Chat ID on Store: When storing a session, a chat ID must be provided either via the property or input JSON; otherwise, an error "No chat ID provided for storing session" is thrown.
- Session Expiry: When retrieving a session, if the session has expired based on the duration, it is deleted and marked as invalid.
- Data Persistence: Since sessions are stored in memory, restarting the workflow or n8n instance clears all stored sessions. Users should be aware that this node does not provide persistent storage.
Links and References
- n8n Documentation
- General concepts of session management in chat applications (no direct link available)