Actions11
Overview
This node manages NATS JetStream streams, allowing users to update the configuration of existing streams. It connects to a NATS server with JetStream enabled and performs operations such as creating, updating, deleting streams, publishing messages, and managing consumers.
The Update Stream operation specifically modifies properties of an existing JetStream stream, such as its subjects, storage type, retention policy, message limits, and replication settings.
Practical Use Cases
- Adjusting stream configurations dynamically without downtime, e.g., changing subjects or retention policies as application requirements evolve.
- Scaling stream resources by increasing replicas or max consumers.
- Modifying message discard policies or storage backend to optimize performance or persistence.
- Managing event-driven architectures where streams represent different event channels.
Properties
| Name | Meaning |
|---|---|
| Stream Name | The name of the JetStream stream to update. Must be descriptive and unique within the JetStream context. |
| Stream Configuration | A collection of configurable options for the stream: - Subjects: List of subjects (topics) the stream consumes; supports wildcards like events.* or events.>.- Description: Human-readable description. - Storage Type: Either "File" (persistent on disk) or "Memory" (in-memory, faster but non-persistent). - Retention Policy: How messages are retained: "Limits" (delete when limits reached), "Interest" (delete when no consumers interested), or "Work Queue" (delete after acknowledgment). - Max Messages: Max number of messages stored (-1 for unlimited). - Max Messages Per Subject: Max messages per subject (-1 for unlimited). - Max Age (Seconds): Max age of messages in seconds (0 for unlimited). - Max Bytes: Max total size in bytes (-1 for unlimited). - Max Message Size: Max individual message size in bytes (-1 for unlimited). - Discard Policy: Policy when limits reached: "Old" (discard old messages) or "New" (reject new messages). - Number of Replicas: Number of replicas (1-5) for availability. - Max Consumers: Max number of consumers (-1 for unlimited). - Duplicate Window (Nanoseconds): Time window for duplicate detection (0 disables). - No Acknowledgments: Boolean to disable acknowledgments for the stream. |
Output
The node outputs JSON data representing the result of the update operation on the stream. This typically includes the updated stream configuration details returned from the JetStream management API.
If multiple input items are processed, the output is an array of JSON objects each paired with the corresponding input item.
The node does not output binary data.
Dependencies
- Requires connection to a NATS server with JetStream enabled.
- Needs an API key credential or equivalent authentication configured in n8n to connect securely to the NATS server.
- Uses bundled NATS client libraries for communication and management operations.
- No additional external services beyond the NATS JetStream server are required.
Troubleshooting
Common Issues:
- Incorrect or missing stream name will cause the update to fail.
- Invalid subject patterns or unsupported wildcard usage may cause errors.
- Setting invalid values for numeric limits (e.g., negative numbers other than -1) can lead to rejection.
- Insufficient permissions or incorrect credentials will prevent connection or operation execution.
- Attempting to update a non-existent stream results in an error.
Error Messages:
"Unknown stream operation: update"— indicates the operation name is misspelled or unsupported."NATS JetStream operation failed: ..."— generic failure, check underlying error message for specifics.- Validation errors related to subject format or configuration parameters.
Resolutions:
- Verify stream name exists before updating.
- Ensure all configuration fields conform to expected types and ranges.
- Confirm credentials and network connectivity to the NATS server.
- Use the node's "Continue On Fail" option to handle partial failures gracefully.