NATS JetStream icon

NATS JetStream

Manage NATS JetStream streams, consumers, and publish messages

Actions11

Overview

This node manages NATS JetStream streams, consumers, and messages. Specifically, for the Stream Delete operation, it deletes an existing JetStream stream by its name. This is useful when you want to clean up or remove unused streams from your JetStream server to free resources or reorganize your messaging infrastructure.

Practical examples include:

  • Removing a test or temporary stream after completing automated workflows.
  • Deleting obsolete streams during maintenance or deployment processes.
  • Automating cleanup of streams that are no longer needed in a dynamic environment.

Properties

Name Meaning
Stream Name The name of the JetStream stream to delete. Stream names should be descriptive to clearly identify their purpose.

Output

The output JSON contains the result of the delete operation. Typically, this will confirm whether the stream was successfully deleted or provide error details if the deletion failed.

Example output structure (conceptual):

{
  "success": true,
  "streamName": "EVENTS"
}

If an error occurs, the output JSON will contain an error field describing the issue.

The node does not output binary data.

Dependencies

  • Requires a valid connection to a NATS JetStream server.
  • Needs an API key credential configured in n8n for authenticating with the NATS server.
  • Uses internal utilities to manage connections and perform operations on JetStream.

Troubleshooting

  • Common issues:

    • Attempting to delete a non-existent stream will likely cause an error.
    • Insufficient permissions or invalid credentials can prevent successful deletion.
    • Network connectivity problems to the NATS server may cause timeouts or failures.
  • Error messages:

    • "Unknown stream operation: delete" — indicates the operation name might be misspelled or unsupported.
    • "NATS JetStream operation failed: <message>" — generic failure message; check the detailed error for specifics.
    • Credential-related errors suggest verifying the API key and connection settings.
  • Resolutions:

    • Ensure the stream name is correct and exists on the server.
    • Verify the API key credential has appropriate permissions.
    • Confirm network access to the NATS JetStream server.
    • Use the node’s “Continue On Fail” option to handle errors gracefully in workflows.

Links and References

Discussion