NATS JetStream icon

NATS JetStream

Manage NATS JetStream streams, consumers, and publish messages

Actions11

Overview

This node interacts with NATS JetStream, a messaging system that supports streams and consumers for reliable message delivery. Specifically, the Consumer - List operation retrieves a list of consumers associated with a specified JetStream stream.

Use cases include:

  • Monitoring existing consumers on a stream to manage message processing.
  • Auditing or debugging consumer configurations.
  • Integrating with workflows that need to dynamically react based on available consumers.

For example, you might use this node to fetch all consumers on a stream named "EVENTS" to check which applications are currently consuming messages from it.

Properties

Name Meaning
Stream Name The name of the JetStream stream whose consumers you want to list. The stream must already exist before listing its consumers.

Output

The output is an array of JSON objects representing the consumers on the specified stream. Each object contains details about a consumer such as its configuration and status (the exact structure depends on the JetStream API response).

Example output snippet (conceptual):

[
  {
    "name": "consumer1",
    "stream": "EVENTS",
    "config": { /* consumer configuration details */ },
    "state": { /* consumer state information */ }
  },
  {
    "name": "consumer2",
    "stream": "EVENTS",
    "config": { /* ... */ },
    "state": { /* ... */ }
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires a valid connection to a NATS JetStream server.
  • Needs an API key credential configured in n8n for authenticating with the NATS server.
  • The target JetStream stream must already exist before listing consumers.

Troubleshooting

  • Common issues:

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

    • "Unknown consumer operation: List" — indicates the operation name is incorrect or unsupported; ensure "List" is used exactly.
    • "NATS JetStream operation failed: <message>" — generic failure; check network, credentials, and stream existence.
    • "Unknown resource: consumers" — means the resource parameter is not set correctly; verify it is "consumers".
  • Resolutions:

    • Verify the stream exists on the JetStream server before running the node.
    • Confirm credentials and network access to the NATS server.
    • Use correct property values matching the node's expected inputs.

Links and References

Discussion