Symbiosika Chat Session Store icon

Symbiosika Chat Session Store

Store and manage Symbiosika chat sessions

Overview

This node, named "Symbiosika Chat Session Store," is designed to manage chat sessions by storing, retrieving, and deleting session data identified by unique session IDs. It maintains an in-memory store of sessions with associated chat IDs and timestamps for last usage. This functionality is useful in scenarios where you need to persist chat context temporarily during workflows, such as managing user conversations in chatbot integrations or tracking session states across multiple workflow executions.

Practical examples include:

  • Storing a chat session ID and its related chat identifier when a new conversation starts.
  • Retrieving the stored chat session information to continue a conversation within a valid time window.
  • Deleting expired or no longer needed chat sessions to free up memory.

Properties

Name Meaning
Session ID A unique identifier for this chat session.

Note: Although the node supports multiple operations (store, get, delete), only the "Session ID" property is required and common to all. Other properties like "Chat ID" and "Session Duration" are operation-specific and not included here per your request focusing on the default resource and operation.

Output

The node outputs an array of items, each containing a json object that merges the input data with additional fields describing the result of the operation:

  • operation: The performed operation status, e.g., "stored", "retrieved", "expired", "not_found", or "deleted".
  • chatId: The chat ID associated with the session (present when storing or retrieving).
  • lastUsed: Timestamp of the last time the session was accessed (for retrieval).
  • valid: Boolean indicating if the retrieved session is still valid (true) or expired/not found (false).
  • existed: Boolean indicating whether the session existed before deletion (only for delete operation).
  • error: If an error occurs and the node is set to continue on failure, this field contains the error message.

The node does not output binary data.

Dependencies

  • No external services or APIs are required; the node uses an internal in-memory Map to store session data.
  • No special environment variables or API keys are necessary.

Troubleshooting

  • Missing Session ID: The node throws an error if the "Session ID" property is empty or missing. Ensure this value is always provided.
  • Missing Chat ID on Store Operation: When storing a session, if no chat ID is provided either via the property or input JSON, the node will throw an error.
  • Session Expiry: Sessions are considered expired if the elapsed time since last use exceeds the configured session duration (default 60 minutes). Expired sessions are deleted automatically.
  • Data Persistence: Since the session store is in-memory, all stored sessions will be lost if the workflow or n8n instance restarts. For persistent storage, consider integrating with an external database or cache.
  • Continue On Fail Behavior: If enabled, errors for individual items do not stop execution but are returned in the output's error field.

Links and References

Discussion