Symbiosika Key-Value Store icon

Symbiosika Key-Value Store

Store and manage key-value pairs

Overview

The "Symbiosika Key-Value Store" node provides a simple in-memory key-value storage mechanism within an n8n workflow. It allows users to store, retrieve, and delete values associated with unique keys during workflow execution. This can be useful for caching data temporarily, sharing state between different parts of a workflow, or managing small pieces of transient information without external databases.

Common scenarios include:

  • Caching API responses to reduce redundant calls.
  • Storing intermediate calculation results for reuse later in the workflow.
  • Managing feature flags or toggles dynamically within workflows.

For example, you could store a user's session token with a specific key and retrieve it later in the workflow to authenticate subsequent requests.

Properties

Name Meaning
Operation The action to perform: "Store Value", "Get Value", or "Delete Value".
Key A unique identifier string for the key-value pair.
Value The value to store associated with the key (used only when storing a value).
Value Type The type of the value to store. Options: Auto-Detect, Boolean, Number, Object (JSON), String.
Value Lifetime (Minutes) How long (in minutes) the stored value remains valid after last use. Applies to storing and getting operations. Defaults to 60 minutes.

Output

The node outputs an array of JSON objects, each representing the result of the operation for an input item. The structure varies depending on the operation:

  • Store Value:

    • operation: "stored" if the value was successfully stored, "dropped" if the value was invalid and removed.
    • key: The key used.
    • value: The stored value (parsed according to the selected type).
  • Get Value:

    • operation: One of "retrieved" (value found and valid), "expired" (value expired and deleted), or "not_found" (no value found).
    • key: The key requested.
    • value: The retrieved value if found and valid.
    • exists: Boolean indicating whether the value exists and is valid.
  • Delete Value:

    • operation: "deleted".
    • key: The key deleted.
    • existed: Boolean indicating whether the key existed before deletion.

No binary data output is produced by this node.

Dependencies

  • This node uses an internal in-memory JavaScript Map object to store key-value pairs.
  • No external services or APIs are required.
  • No special credentials or environment variables are needed.
  • Note that the storage is ephemeral and lasts only as long as the workflow process runs; restarting n8n will clear all stored data.

Troubleshooting

  • Missing Key Error: If no key is provided, the node throws an error "No key provided". Ensure the "Key" property is set for every input item.
  • Invalid Value Parsing: When using "Auto-Detect" or "Object (JSON)" value types, invalid JSON strings will cause the value to be dropped (not stored). Verify that JSON strings are well-formed.
  • Value Expiry: Values expire after the specified lifetime since last access. If a value is unexpectedly missing, check the "Value Lifetime" setting.
  • Non-positive Lifetime: If the lifetime is set to zero or negative, it defaults internally to 60 minutes.
  • Data Persistence: Since storage is in-memory, all stored data is lost if the node or workflow restarts. For persistent storage, consider external databases or other nodes.

Links and References

Discussion