Actions11
Overview
This node manages NATS JetStream consumers, streams, and messages. Specifically for the Consumer Delete operation, it deletes a specified consumer from a given JetStream stream. This is useful when you want to clean up or remove consumers that are no longer needed, such as after processing is complete or when reconfiguring your message consumption topology.
Practical examples include:
- Removing a consumer that was used for batch processing of events once the batch job finishes.
- Cleaning up stale or unused consumers to free resources in your JetStream environment.
- Automating lifecycle management of consumers in CI/CD pipelines or operational workflows.
Properties
| Name | Meaning |
|---|---|
| Stream Name | The name of the JetStream stream where the consumer exists. The stream must already exist. |
| Consumer Name | The name of the consumer to delete. |
Output
The output JSON contains the result of the delete operation. Typically, this will be an object indicating success or details about the deleted consumer. If an error occurs, the output will contain an error field with the error message.
No binary data is output by this operation.
Example output JSON might look like:
{
"success": true,
"consumerName": "order-processor",
"streamName": "EVENTS"
}
or on failure:
{
"error": "Consumer not found",
"resource": "consumers",
"operation": "delete"
}
Dependencies
- Requires a valid connection to a NATS JetStream server.
- Needs an API key credential or equivalent authentication token configured in n8n to connect securely to the NATS server.
- The target JetStream stream must already exist before deleting a consumer.
Troubleshooting
Common issues:
- Attempting to delete a consumer from a non-existent stream will fail.
- Deleting a consumer that does not exist will result in an error.
- Network or authentication failures connecting to the NATS server can cause operation failure.
Error messages:
"Unknown consumer operation: delete"— indicates the operation name is incorrect or unsupported; ensure "delete" is selected."NATS JetStream operation failed: <message>"— generic failure; check credentials, network connectivity, and stream/consumer names."Consumer not found"— the specified consumer name does not exist on the given stream; verify names are correct.
Resolutions:
- Verify the stream and consumer names are correct and exist.
- Confirm the NATS server is reachable and credentials are valid.
- Use the node’s "Continue On Fail" option to handle errors gracefully in workflows.