Overview
This node acts as a trigger that listens for events from the EnlightenedMSP system via NATS messaging. It connects to a specified NATS server and subscribes to a particular event within a given namespace, optionally using a queue group for load balancing. When an event matching the subscription is received, the node emits the event data as JSON output.
Common scenarios include:
- Automating workflows based on real-time events from the EnlightenedMSP platform.
- Integrating with other systems by reacting to specific operational or status events.
- Load balancing event processing across multiple instances using queue groups.
For example, you could use this node to trigger a workflow whenever a new alert is published in the "production" namespace or to process deployment notifications in a "staging" environment.
Properties
| Name | Meaning |
|---|---|
| Namespace | The namespace for the NATS event (e.g., "production", "staging"). Defines the event domain. |
| Queue Group | Optional queue group name used for load balancing event consumption among multiple subscribers. |
| Event | The specific event name to listen for within the namespace. |
Output
The node outputs JSON data representing the event payload received from the NATS message. The structure of the JSON depends on the event but is parsed from the raw message data into a JavaScript object.
If the incoming message cannot be parsed as JSON, an error is logged, but no output is emitted for that message.
No binary data output is produced by this node.
Dependencies
- Requires connection credentials to a NATS server, including server URL, username, password, and/or token.
- Uses the
natsnpm package to connect and subscribe to events. - Requires proper configuration of the EnlightenedMSP NATS credentials in n8n to authenticate with the NATS server.
Troubleshooting
- Connection failures: Ensure the NATS server URL and authentication credentials are correct and accessible from the n8n instance.
- No events received: Verify the namespace and event names match exactly what is published on the NATS server. Check if the optional queue group is correctly set if used.
- JSON parsing errors: If the incoming message is not valid JSON, it will cause a parsing error logged to the console. Confirm that the event publisher sends properly formatted JSON messages.
- Load balancing issues: When using a queue group, only one subscriber in the group receives each message. Make sure this behavior matches your intended design.
Links and References
- NATS Official Documentation
- EnlightenedMSP Platform (if publicly available) (example placeholder)