Symbiosika Chat Session Store icon

Symbiosika Chat Session Store

Store and manage Symbiosika chat sessions

Overview

This node, named "Symbiosika Chat Session Store," manages chat sessions by storing, retrieving, and deleting session data identified by a unique session ID. It is useful in scenarios where chat interactions need to be tracked or persisted temporarily, such as maintaining context in chatbot conversations or managing user sessions in messaging applications.

Practical examples:

  • Storing a chat session with an associated chat ID when a user starts a conversation.
  • Retrieving a stored session to continue a chat within a valid time window.
  • Deleting a session when it is no longer needed or has 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 storing) The chat ID to associate with the session.
Session Duration (Minutes) (For storing and getting) How long a session remains valid after last use, in minutes.

Output

The node outputs JSON objects that include the original input merged with operation results:

  • For Store Session:
    • operation: "stored"
    • chatId: The chat ID stored
  • For Get Session:
    • operation: "retrieved" if session found and valid, "expired" if session expired, or "not_found" if no session exists
    • chatId: The chat ID associated with the session (if retrieved)
    • lastUsed: Timestamp of last access (if retrieved)
    • valid: Boolean indicating if the session is still valid
  • For Delete Session:
    • operation: "deleted"
    • existed: Boolean indicating if the session existed before deletion

If an error occurs and the node is set to continue on failure, the output includes an error field describing the issue.

Dependencies

  • This node uses an internal in-memory Map object to store sessions during runtime.
  • No external services or API keys are required.
  • Sessions exist only while the node instance is active; restarting the workflow or n8n will clear stored sessions.

Troubleshooting

  • No session ID provided: The node requires a session ID for all operations. Ensure this property is set.
  • No chat ID provided when storing: When storing a session, a chat ID must be supplied either via the input data or the node parameter.
  • Session expired or not found: When retrieving, if the session duration has passed since last use, the session is deleted and marked expired.
  • Data persistence: Since sessions are stored in memory, they do not persist across workflow executions or system restarts. Use an external database or storage if persistence is needed.

Links and References

Discussion