ChatBot Enhanced
Enhanced chatbot node with Redis/Valkey integration for rate limiting, session management, and advanced features
Actions14
- Rate Limiting Actions
- Session Actions
- Message Actions
- Analytics Actions
Overview
The ChatBot Enhanced node provides advanced chatbot-related functionalities leveraging Redis for storage and management. Specifically, the Analytics - Generate Report operation creates comprehensive performance and usage reports based on tracked analytics data.
This node is beneficial in scenarios where you want to monitor chatbot interactions, analyze user engagement, and generate detailed reports for performance metrics. For example, it can be used to:
- Generate hourly or daily reports summarizing message volumes and user activity.
- Track custom events and visualize trends over time.
- Monitor chatbot health and usage statistics for optimization.
Properties
| Name | Meaning |
|---|---|
| Session Key | Unique identifier for the user or session; can use expressions to dynamically set this value. |
| Message Content | The message content to process; supports expressions to extract from input data. |
| Enable Debug Mode | Whether to enable detailed logging and debug information during execution (true/false). |
| Redis Key Prefix | Prefix string for Redis keys to avoid collisions with other applications or nodes. |
Output
The node outputs JSON objects with the following structure when generating an analytics report:
message: The original message content processed.sessionId: The session or user key used.operationType: Always"analytics"for this operation.eventTracked: Boolean indicating if the event was successfully tracked.analytics: An array of metric entries retrieved from the analytics store, each containing aggregated counts and timestamps.
Additionally, the node emits metrics data including:
eventsTracked: Number of events recorded (typically 1 per execution).analyticsEntries: Number of analytics records returned.totalCount: Sum of all counted events in the retrieved analytics data.performance.processingTime: Time taken to process the request (static 0 in code, but placeholder for real timing).performance.redisHealth: Boolean indicating Redis connection health status.
No binary data output is produced by this operation.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Uses Redis for storing and querying analytics data.
- The node depends on internal managers for analytics tracking which handle batching, retention, and querying.
- No additional external APIs are required beyond Redis.
Troubleshooting
- Redis Connection Failures: If the node cannot connect to Redis, it will throw connection errors. Ensure Redis credentials are correct and the server is reachable.
- Empty Analytics Data: If no analytics data is returned, verify that events have been tracked previously and that the time window for queries is appropriate.
- Performance Issues: Large datasets may cause delays; consider adjusting batch sizes or retention periods.
- Debug Mode: Enabling debug mode helps trace processing steps and identify issues with data retrieval or event tracking.