Chatbot Enhanced - Trigger
AI-generatedOverview
This node is a real-time trigger for monitoring Redis key changes and session events, designed for use with ChatBot Enhanced workflows. It listens to Redis keyspace notifications based on user-defined key patterns and event types, such as key creation, deletion, expiration, or eviction. The node supports rate limiting to prevent event storms and includes advanced options for connection management and metadata inclusion. It is beneficial for workflows that need to react instantly to Redis data changes, such as updating chatbot sessions, tracking user activity, or managing cache invalidation.
Use Case Examples
- Monitor specific Redis keys matching pattern 'chatbot:*' for set and delete events to trigger chatbot session updates.
- Track all Redis keys (with caution due to performance impact) to trigger workflows on any key change event.
- Use rate limiting to handle high-frequency Redis events without overwhelming the workflow.
Properties
| Name | Meaning |
|---|---|
| Key Monitoring | Select how to monitor Redis keys, either all keys or specific key patterns. |
| Key Pattern | The Redis key pattern to monitor, supporting glob patterns like * and ?; used when 'Choose Key' mode is selected. |
| Event Types | Select which Redis events (set, del, expired, evicted) should trigger the workflow. |
| Rate Limiting | Enable or disable rate limiting to prevent event storms. |
| Max Events Per Second | Maximum number of Redis events to process per second when rate limiting is enabled. |
| Advanced Options | Additional connection and behavior settings including connection timeout, reconnect attempts, and whether to include event metadata. |
Output
JSON
eventType- Type of Redis event that triggered the workflow (e.g., set, del, expired, evicted).key- The Redis key involved in the event.value- The value of the key if available; null otherwise.database- The Redis database number where the event occurred.timestamp- Timestamp of when the event occurred.metadatapattern- The key pattern used for monitoring (if metadata inclusion is enabled).triggerId- The unique identifier of the trigger node instance.workflowId- The unique identifier of the workflow.nodeVersion- Version of the node.
Dependencies
- Redis server with keyspace notifications enabled
- An API key credential for Redis connection
Troubleshooting
- Invalid key pattern error: Ensure the key pattern uses valid glob syntax as described in the pattern help notice.
- Invalid event types error: Verify that selected event types are among set, del, expired, evicted.
- Redis connection errors: Check Redis credentials (host, port) and server availability; ensure Redis server supports keyspace notifications.
- Performance issues when tracking all keys: Use 'Choose Key' mode with specific patterns in production to avoid high CPU and network usage.
- Event storm issues: Enable rate limiting and configure max events per second to prevent workflow overload.
Links
- Redis Keyspace Notifications - Official Redis documentation on keyspace notifications, which this node relies on.
- n8n Trigger Nodes Documentation - General documentation for trigger nodes in n8n, including usage and configuration guidance.