NATS Object Store icon

NATS Object Store

Store and retrieve objects (files, data) in NATS JetStream Object Store - manage buckets and objects

Overview

This node integrates with NATS JetStream Object Store, allowing users to manage buckets and objects within those buckets. It supports operations such as creating, deleting, and retrieving information about buckets, as well as uploading, downloading, deleting, and getting metadata of objects stored inside these buckets.

A common use case is managing files or data blobs in a distributed messaging system environment where NATS JetStream is used for persistence. For example, you might store reports, images, or configuration files as objects in buckets and retrieve or update them programmatically within an n8n workflow.

Specifically, the Get Info operation on the Object resource retrieves metadata or details about a specific object stored in a given bucket.

Properties

Name Meaning
Bucket Name The name of the bucket where the object resides. Must contain only letters, numbers, hyphens, and underscores; no spaces or dots allowed. Example: my-files
Object Name The path or name of the object within the bucket. Can include forward slashes for organization. Examples: reports/2024/sales.pdf, images/logo.png

Output

The node outputs JSON data representing the result of the requested operation. For the Get Info operation on an object, this typically includes metadata about the object such as its size, creation date, modification date, and other relevant attributes provided by the NATS JetStream Object Store API.

If the node handles binary data (e.g., when retrieving the actual content of an object), it would output that data in the binary property of the item, but for the Get Info operation, the output is purely JSON metadata.

Dependencies

  • Requires a connection to a NATS JetStream server.
  • Needs an API key credential configured in n8n to authenticate with the NATS server.
  • Uses bundled NATS client libraries to interact with the JetStream Object Store.
  • Proper bucket names must be validated according to NATS naming rules (letters, numbers, hyphens, underscores).

Troubleshooting

  • Invalid bucket name error: If the bucket name contains spaces, dots, or invalid characters, the node will throw a validation error. Ensure bucket names follow the allowed pattern.
  • Unknown operation or resource errors: If an unsupported operation or resource is specified, the node throws an error indicating the unknown operation/resource. Verify that the selected operation and resource are supported.
  • Connection issues: Failure to connect to the NATS server due to incorrect credentials or network problems will cause errors. Check your API key credential and network connectivity.
  • Object not found: When requesting info for an object that does not exist in the specified bucket, the node may return an error or empty response. Confirm the object name and bucket are correct.
  • Continue On Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error details per item.

Links and References

Discussion