Lola Store v2 icon

Lola Store v2

Lola Store allows you to store data in Lola related to a specific tenant/chatSession

Lola Store v2

AI-generated

Overview

The Lola Store v2 node allows you to interact with a key-value store associated with a specific chat or session. It supports three main operations: retrieving a value, setting a value, and clearing chat history. This node is useful for workflows that need to persist data across different executions, such as storing user preferences, session states, or maintaining chat histories.

Common scenarios:

  • Storing and retrieving user-specific settings during a conversation.
  • Maintaining stateful information between workflow runs.
  • Clearing chat history while optionally retaining the last N messages.

Practical examples:

  • Save a user's last selected language in a chatbot.
  • Retrieve a stored authentication token for API calls.
  • Clear all but the last 5 messages from a chat session for privacy reasons.

Properties

Name Meaning
Operation The action to perform:
- Get: Get a value from the store
- Set: Set a value in the store
- Clear: Clear chat history
Chat/Session Identifier An identifier to individualize the chat/session. Used to scope the storage to a particular user or conversation.
Store Key The key to store/retrieve a value under/from. Required for "Get" and "Set" operations.
Store Value / GET Default Value The value to store (for "Set") or the default value to return if not found (for "Get").
Enable TTL Whether to enable time-to-live (TTL) for the key/value pair so it will be deleted after the TTL expires. Only shown for "Get" and "Set".
TTL (Seconds) The number of seconds before the key/value pair expires. Only shown if "Enable TTL" is true and operation is "Get" or "Set".
Keep Last # Messages The number of messages to keep in the chat history when clearing. Only shown for the "Clear" operation.

Output

  • The output is an object containing a lola_store field within the json property.
  • The lola_store field is itself an object where each key corresponds to a stored key, and its value is the latest value retrieved or set.
  • Example output:
{
  "lola_store": {
    "userLanguage": "en",
    "sessionToken": "abc123"
  }
}
  • If the operation is "clear", the output reflects the updated state of the store after clearing, possibly retaining only the specified number of last messages.

Dependencies

  • May require credentials named lolaKeyApi if configured, but they are not strictly required.
  • Relies on internal helper functions for interacting with the Lola store.

Troubleshooting

Common issues:

  • Missing required fields: For "Get" and "Set" operations, "Store Key" is required. Ensure this field is filled.
  • Invalid TTL values: If TTL is enabled, ensure the "TTL (Seconds)" field contains a valid integer.
  • Empty results: If a key does not exist in the store, the returned value may be empty or fallback to the provided default.

Error messages:

  • Errors related to missing parameters or invalid input types may occur if required fields are not provided.
  • If the underlying store service is unavailable, errors may indicate connection or timeout issues.

Links and References

  • n8n Documentation
  • Internal documentation for Lola Store (if available within your organization)

Discussion