Overview
This node interacts with the NATS JetStream Key-Value (KV) store, specifically managing keys within KV buckets. The "Get" operation for the "Key" resource retrieves the value associated with a specified key inside a given bucket.
Common scenarios where this node is useful include:
- Fetching user preferences or configuration settings stored in a distributed KV store.
- Retrieving cached data or session information keyed by unique identifiers.
- Accessing hierarchical data organized by dot-separated keys (e.g.,
user.123.settings).
For example, you might use this node to get the current configuration of a microservice stored under a key like config.database.host in a bucket named app-config.
Properties
| Name | Meaning |
|---|---|
| Bucket Name | The name of the KV bucket to operate on. Must contain only letters, numbers, underscores, and hyphens (no spaces or dots). Example: user-preferences, app-config, cache-data. |
| Key | The key to retrieve from the bucket. Supports dot notation for hierarchical organization (e.g., user.123.settings). Cannot contain spaces. Example: config.database.host, user.profile.avatar, session.abc123. |
Output
The output JSON contains the result of the "Get" operation on the specified key. Typically, it includes the value stored at that key along with metadata such as revision/version info depending on the underlying NATS KV implementation.
If the key exists, the output JSON will have the key's value and possibly additional details about the entry. If the key does not exist or an error occurs, the node may throw an error or return an error object if configured to continue on failure.
This node does not output binary data; all outputs are JSON objects representing the key-value data retrieved.
Dependencies
- Requires a connection to a NATS JetStream server with access to the KV store.
- Needs an API authentication credential configured in n8n to connect securely to the NATS server.
- Uses the bundled
nats-bundledlibrary and utility modules for connection management and operations.
Troubleshooting
- Invalid Bucket Name: Bucket names must only contain letters, numbers, underscores, and hyphens. Using spaces or dots will cause validation errors.
- Key Not Found: Attempting to get a non-existent key may result in an error or empty response. Verify the key name and bucket.
- Connection Issues: Errors connecting to the NATS server usually indicate misconfigured credentials or network problems.
- Unknown Operation or Resource: If the operation or resource parameter is incorrect, the node throws an error indicating the unknown operation/resource.
- Continue On Fail: If enabled, the node will capture errors per item instead of stopping execution, allowing partial success.