Overview
This node, named "Symbiosika Chat Session Store," is designed to manage chat sessions by storing, retrieving, and deleting session data in memory during workflow execution. It is useful for scenarios where you need to maintain state or context across multiple steps or executions within a chat-based automation, such as tracking user conversations or session-specific data temporarily.
Practical examples include:
- Storing a chat session ID with an associated chat identifier to keep track of ongoing conversations.
- Retrieving session information to validate if a session is still active based on its last usage time.
- Deleting sessions when they are no longer needed or have expired.
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 | (Only for Store Session) The chat ID to associate with this session |
Session Duration (Minutes) | (For Store Session and Get Session) How long a session remains valid after last use, in minutes |
Output
The node outputs an array of items, each containing a json
object that merges the input data with additional fields depending on the operation performed:
- For Store Session:
operation
:"stored"
chatId
: The stored chat ID
- For Get Session:
operation
:"retrieved"
if session is found and valid,"expired"
if session expired, or"not_found"
if no session existschatId
: The chat ID associated with the session (if retrieved)lastUsed
: Timestamp of the last access time (if retrieved)valid
: Boolean indicating if the session is currently valid
- For Delete Session:
operation
:"deleted"
existed
: Boolean indicating whether the session existed before deletion
No binary data output is produced by this node.
Dependencies
- This node uses an internal in-memory Map to store session data; it does not require external services or API keys.
- No special n8n credentials or environment variables are needed.
- Note that session data is ephemeral and will be lost if the workflow or n8n instance restarts.
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 parameter or input JSON; otherwise, an error "No chat ID provided for storing session" is thrown.
- Session Expiry: Sessions expire based on the configured duration since last use. If a session is expired, retrieval returns
"expired"
and marks the session invalid. - Data Persistence: Since storage is in-memory, sessions do not persist beyond the current runtime. Users expecting persistent storage should consider external databases or services.