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. Specifically for the Put Object operation on the Object resource, it enables storing data (files or arbitrary content) into a specified bucket under a given object name or path.

Common scenarios include:

  • Uploading files or data blobs to a NATS JetStream Object Store bucket for later retrieval.
  • Organizing data hierarchically by using paths in object names (e.g., reports/2024/sales.pdf).
  • Automating backup or archival workflows where data needs to be stored reliably in an object store.

Practical example:

  • A user wants to save a generated PDF report into a bucket named my-files under the path reports/2024/sales.pdf. They provide the file content as a string, and the node stores it in the object store for future access.

Properties

Name Meaning
Bucket Name The target bucket where the object will be stored. Must contain only letters, numbers, hyphens, and underscores; no spaces or dots allowed. Example: my-files.
Object Name The name or path of the object inside the bucket. Can include forward slashes for organization. Example: reports/2024/sales.pdf.
Data The content to store in the object. Provided as a string, which will be encoded and saved as the object's data.

Output

The node outputs JSON data representing the result of the put operation. This typically includes metadata about the stored object such as confirmation of success, version info, or other relevant details returned by the NATS JetStream Object Store API.

If binary data is involved, it is handled internally by encoding the input string into bytes before storage, but the output itself is JSON metadata describing the stored object.

Dependencies

  • Requires a connection to a NATS JetStream server with Object Store enabled.
  • Needs an API key credential or equivalent authentication configured in n8n to connect securely to the NATS server.
  • Uses bundled NATS client libraries to interact with the JetStream Object Store.
  • No additional external services are required beyond the NATS JetStream environment.

Troubleshooting

  • Invalid bucket name error: Bucket names must not contain spaces or dots and can only use letters, numbers, hyphens, and underscores. Ensure your bucket name follows these rules.
  • Unknown operation or resource errors: If you specify an unsupported operation or resource, the node will throw an error. Verify that "resource" is set to "object" and "operation" to "put" for this use case.
  • Connection failures: Make sure the NATS server credentials are correct and the server is reachable.
  • Data encoding issues: The node encodes the input string as UTF-8 bytes before storing. Providing non-string data without proper conversion may cause unexpected results.
  • 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