NATS KV icon

NATS KV

Interact with NATS JetStream Key-Value Store - manage buckets and keys

Actions8

Overview

This node interacts with the NATS JetStream Key-Value (KV) Store, specifically managing KV buckets and keys within those buckets. The "Delete" operation on the "Bucket" resource allows users to delete an entire KV bucket from the NATS JetStream system.

Common scenarios for this node include:

  • Automating the cleanup of unused or obsolete KV buckets in a NATS JetStream environment.
  • Managing lifecycle of data storage buckets programmatically as part of CI/CD pipelines or operational workflows.
  • Integrating NATS KV management into broader event-driven automation where buckets need to be created, updated, or deleted dynamically.

For example, a user might configure this node to delete a bucket named "my-bucket" when a certain condition is met, such as after processing all related messages or archiving data elsewhere.

Properties

Name Meaning
Bucket Name The name of the KV bucket to delete. Bucket names can only contain alphanumeric characters, dashes, and underscores.

Output

The output of the node is a JSON object representing the result of the delete operation on the specified bucket. The exact structure depends on the underlying NATS JetStream response but generally confirms whether the deletion was successful.

If an error occurs during the operation, the node outputs an error object describing the failure.

No binary data output is produced by this operation.

Dependencies

  • Requires a valid connection to a NATS JetStream server with access to the KV store.
  • Needs an API authentication token or key credential configured in n8n to establish the connection.
  • Uses the nats client library bundled internally for communication with the NATS server.
  • Proper permissions on the NATS server to delete KV buckets are necessary.

Troubleshooting

  • Invalid Bucket Name: If the bucket name contains invalid characters, the node will throw a validation error. Ensure bucket names only use alphanumeric characters, dashes, and underscores.
  • Unknown Operation or Resource: If the operation or resource parameter is incorrect or unsupported, the node will report an "Unknown bucket operation" or "Unknown resource" error.
  • Connection Issues: Failure to connect to the NATS server due to incorrect credentials or network issues will cause errors. Verify credentials and network accessibility.
  • Permission Denied: If the authenticated user lacks permission to delete buckets, the operation will fail. Check server-side permissions.
  • Continue On Fail: If enabled, the node will continue processing other items even if one fails, collecting errors in the output.

Links and References

Discussion