Package Information
Available Nodes
Documentation
š¤ n8n-nodes-chatbot-enhanced
š Production-ready chatbot enhancement node for n8n workflows with Redis/Valkey integration.
ā” High-performance architecture supporting 100-200+ operations per second with enterprise-grade error handling, multi-output streams, and real-time analytics.
š„ Key Features:
- š”ļø Smart Rate Limiting with burst protection and penalty systems
- š¾ Session Management with context storage and automatic cleanup
- ā±ļø Message Buffering with š”ļø Anti-Spam Detection (1-3600 seconds)
- š§ Smart Memory for conversation, FAQ, and context management
- š Message Routing with multi-channel support and load balancing
- š¤ User Storage for profiles, preferences, and history
- š Real-time Analytics with performance monitoring and alerts
- šØ NEW! š”ļø Built-in Anti-Spam Protection with pattern detection and flood protection
Installation
Operations
Credentials
Compatibility
Usage
Resources
Version history
Installation
Follow the installation guide in the n8n community nodes documentation.
Install the package in your n8n installation:
# In your n8n installation directory
npm install @trigidigital/n8n-nodes-chatbot-enchanced
Or install directly from npm registry:
npm install -g @trigidigital/n8n-nodes-chatbot-enchanced
Operations
The ChatBot Enhanced node uses a Resource/Operation pattern for easy discovery and organized functionality:
š”ļø Rate Limiting Actions
Smart rate limiting with burst protection and penalties
- Check Rate Limit: Verify if user is within rate limits and get remaining quota
- Reset User Limits: Clear rate limiting counters for specific user
- Get Limit Status: Retrieve comprehensive rate limiting statistics
š„ Session Actions
User session management and storage operations
- Create Session: Initialize a new user session with context storage
- Update Session: Add message to session and extend timeout
- Get Session Data: Retrieve session information and conversation history
- Store User Data: Save user preferences, history and profile information
š¬ Message Actions
Message buffering and routing for human-like responses with anti-spam protection
- Buffer Messages: CRITICAL FEATURE - Collect multiple messages and flush after time delay (TimedBuffer implementation) with š”ļø built-in anti-spam detection
- Route Messages: Direct messages to appropriate channels or queues
- Process Queue: Handle queued messages with priority and load balancing
š Analytics Actions
Smart memory, metrics tracking and performance monitoring
- Track Event: Record custom events for analytics and monitoring
- Query Metrics: Retrieve analytics data and performance statistics
- Store Memory: Save conversation context, FAQ or knowledge data
- Generate Report: Create comprehensive performance and usage reports
š Multiple Outputs (Enterprise Architecture) - UPDATED v0.1.4!
The node provides 2 streamlined outputs for simplified workflow management:
- ā Main: Successfully processed messages, operation results, and clean data (combines Success + Processed)
- š Status: Error handling, metrics, spam detection alerts, and system health (combines Error + Metrics)
š”ļø Anti-Spam Detection Status: The Status output now includes comprehensive spam detection information:
- Spam detection results with confidence scores
- Blocked message statistics
- Pattern matching details
- Flood protection alerts
š Performance Specifications
- Throughput: 100-200+ operations per second
- Latency: 3-10ms average response time
- Reliability: Enterprise-grade error handling and retry mechanisms
- Scalability: Supports Redis clusters and high-availability setups
- Memory: Efficient memory usage with compression and cleanup
Credentials
To use this node, you need to set up Redis API credentials. The node supports multiple Redis connection types:
Prerequisites
- A running Redis or Valkey server (version 6.0+ recommended)
- Network access to your Redis instance
- Appropriate authentication credentials if required
Available Authentication Methods
Standard Connection: Direct connection to a single Redis instance
- Host and port configuration
- Optional database selection (0-15)
Redis Cluster: Connection to a Redis cluster setup
- Multiple host:port pairs for cluster nodes
- Automatic node discovery and failover
Redis Sentinel: Connection through Redis Sentinel for high availability
- Sentinel host:port pairs
- Master instance name configuration
Authentication Options
- None: No authentication required
- Password Only: Redis AUTH command with password
- Username & Password: Redis 6.0+ ACL authentication
Security Features
- SSL/TLS encryption support with certificate validation
- Connection options including timeouts, retry logic, and keep-alive
- Advanced SSL configuration with custom certificates and keys
Connection Testing
The credential configuration includes automatic connection testing to validate your Redis setup before using the node.
Compatibility
- Minimum n8n version: 1.0.0
- Node.js version: 20.15 or higher
- Redis/Valkey version: 6.0 or higher (recommended)
- Tested against: n8n versions 1.0.0+
Known Compatibility Issues
- Redis versions below 6.0 may not support username/password authentication
- Some advanced features require Redis 6.2+ for optimal performance
- SSL/TLS features require proper certificate configuration
š” Usage
š Quick Start (Resource/Operation Pattern)
- Add Redis Credentials: Configure your Redis connection in n8n credentials
- Add ChatBot Enhanced Node: Drag the node into your workflow
- Select Resource: Choose from 4 action categories:
- Rate Limiting Actions: For spam protection and user quotas
- Session Actions: For user session management and storage
- Message Actions: For buffering and routing (human-like responses)
- Analytics Actions: For metrics, memory, and performance monitoring
- Choose Operation: Select specific action within the resource category
- Configure Parameters:
- Session Key:
={{$json.userId || $json.sessionId}} - Message Content:
={{$json.message || $json.text}} - Resource-specific settings (buffer time, rate limits, etc.)
- Session Key:
- Connect Outputs: Wire Success, Processed, Error, and Metrics outputs
āļø Advanced Configuration Tips
- Buffer Time: 1-3600 seconds for message buffering (human-like delays)
- Rate Limits: Requests per minute with burst protection
- Session Timeouts: Minutes for session management
- Resource Planning: Each buffering session = 1 long-running execution
Resource/Operation Examples
Rate Limiting Actions Example:
Resource: "Rate Limiting Actions"
Operation: "Check Rate Limit"
Session Key: ={{$json.userId}}
Rate Limit: 10 // requests per minute
Message Buffering Example:
Resource: "Message Actions"
Operation: "Buffer Messages"
Session Key: ={{$json.userId}}
Message Content: ={{$json.message}}
Buffer Time: 10 // seconds - creates human-like delays
Session Management Example:
Resource: "Session Actions"
Operation: "Update Session"
Session Key: ={{$json.userId}}
Message Content: ={{$json.message}}
Session Timeout: 30 // minutes
Output Handling - UPDATED v0.1.4!
Connect the two streamlined outputs to handle different scenarios:
- Main output: Continue normal flow processing with clean, spam-free data
- Status output: Implement error handling, monitor performance, and handle spam detection alerts
Expression Usage
The node supports n8n expressions for dynamic configuration:
// Session key from incoming data
={{$json.userId || $json.sessionId || "anonymous"}}
// Message content from various fields
={{$json.message || $json.text || $json.content}}
šÆ Message Buffering + š”ļø Anti-Spam - Human-Like Response (ENHANCED in v0.1.4!)
ā±ļø Revolutionary TimedBuffer Implementation with Built-in Anti-Spam Protection - The FLAGSHIP feature for human-like chatbot responses:
š§ How It Works (TimedBuffer Logic + Anti-Spam)
// REAL BEHAVIOR with anti-spam protection:
Chat 1: "Hello" ā Master Execution: Start 10s timer, wait...
Chat 2: "How are you?" ā Slave Execution: Add to buffer, extend timer, return "pending"
Chat 3: "spam spam spam" ā Slave Execution: š”ļø BLOCKED by anti-spam detection!
Chat 4: "What's your name?" ā Slave Execution: Add to buffer, extend timer, return "pending"
After 10 seconds ā Master Execution: Return CLEAN MESSAGES only!
// Output: ["Hello", "How are you?", "What's your name?"] (spam filtered out)
š”ļø Anti-Spam Detection Features
- Repeated Text Detection: Automatically blocks duplicate or very similar messages
- Flood Protection: Prevents rapid message spamming within time windows
- Pattern Recognition: Detects URLs, excessive caps, phone numbers, emails
- Custom Regex Patterns: Advanced users can define custom spam patterns
- Configurable Actions: Block, delay, or mark spam messages
- Smart Filtering: Only clean messages are included in the final batch
š Execution Pattern
- Master Execution: First message creates buffer, waits for timer, collects all messages
- Slave Executions: Subsequent messages extend timer, add to buffer, return immediately
- Natural Delay: Human-like response delay (not instant robot replies)
- Batch Collection: All messages returned together after timeout
āļø Configuration (Enhanced v0.1.4)
Buffer Time: 10 // Wait 10 seconds before responding
Session Key: {{$json.userId}} // Group messages by user
Message: {{$json.message}} // Content to buffer
// š”ļø NEW Anti-Spam Settings (Optional)
Anti-Spam Detection: "Repeated Text" // or "Flood Protection", "Pattern Match"
Spam Action: "Block Message" // or "Delay Extra", "Mark as Spam"
Similarity Threshold: 80 // % similarity for spam detection
Flood Time Window: 30 // seconds to check for rapid messages
Flood Max Messages: 3 // max messages allowed in time window
šÆ Perfect For:
- Human-like Chatbots: Wait for multiple messages before responding (like humans do)
- Conversation Context: Collect user's complete thought before processing
- Natural UX: Avoid instant robot-like responses + filter out spam
- WhatsApp/Telegram Style: Mimic how humans read 2-3 messages then respond
- š”ļø Customer Support: Automatically handle spam attempts and repeated messages
- š High-Volume Bots: Built-in protection against abuse and flooding
ā ļø Production Requirements:
- Execution Timeout: Set workflow timeout to 60 seconds
- Redis Monitoring: Health checks for buffer persistence
- Resource Planning: Each session = 1 long-running execution
- Traffic Limits: Optimal for 5-50 concurrent users
š Response Types (Enhanced v0.1.4):
// Buffered (Chat 2,3,4...)
{
"type": "buffered",
"status": "pending",
"message": "How are you?",
"spamDetection": {
"isSpam": false,
"actionTaken": "allowed"
}
}
// Spam Blocked
{
"type": "spam_blocked",
"status": "blocked",
"message": "spam spam spam",
"spamDetection": {
"isSpam": true,
"spamType": "repeated",
"confidence": 95,
"actionTaken": "blocked"
}
}
// Batch Ready (After timer - Clean Messages Only!)
{
"type": "batch_ready",
"status": "flushed",
"messages": ["Hello", "How are you?", "What's your name?"],
"spamStats": {
"totalMessages": 4,
"spamDetected": 1,
"spamBlocked": 1,
"cleanMessages": 3
}
}
šļø Architecture & Performance
Multi-Manager Architecture (Enhanced v0.1.4):
- š§ RedisManager: Connection handling with auto-retry and health checks
- š”ļø RateLimiter: Sliding window with burst detection and penalties
- š¾ SessionManager: Context storage with TTL and cleanup
- š¦ MessageBuffer: Time/size-based buffering with š”ļø integrated anti-spam detection
- š SpamDetector: Hash-based similarity detection, flood protection, pattern matching
- š§ SmartMemory: Conversation and FAQ storage with compression
- š MessageRouter: Multi-channel routing with load balancing
- š¤ UserStorage: Profile and preference management
- š AnalyticsTracker: Real-time metrics with histogram generation
Performance Optimizations:
- Connection pooling for high-volume scenarios
- Batch processing for Redis operations
- Memory compression for large datasets
- TTL-based automatic cleanup
- Health monitoring and alerting
Resources
- n8n community nodes documentation
- Redis Documentation
- Valkey Documentation
- n8n Expression Reference
- Node.js Redis Client
Version history
0.1.11 (Current) - Anti-Spam Enhancement & Output Consolidation
š”ļø NEW ANTI-SPAM PROTECTION: Built-in spam detection for Message Buffering operations
- Repeated Text Detection: Hash-based similarity detection with configurable thresholds
- Flood Protection: Prevents rapid message spamming within time windows
- Pattern Recognition: Detects URLs, excessive caps, phone numbers, emails, repeated characters
- Custom Regex Patterns: Advanced users can define custom spam detection patterns
- Configurable Actions: Block, delay extra time, or mark spam messages
- Smart Filtering: Only clean messages included in final batch output
š OUTPUT CONSOLIDATION: Simplified from 4 outputs to 2 streamlined outputs
- Main Output: Clean, spam-free data (combines Success + Processed)
- Status Output: Errors, metrics, and spam detection alerts (combines Error + Metrics)
- Backward Compatibility: Existing workflows continue to work with output routing metadata
š ENHANCED RESPONSE TYPES: New spam detection information in all responses
- Spam detection results with confidence scores and action taken
- Comprehensive spam statistics in batch outputs
- Detailed spam type identification (repeated, flood, pattern)
šļø NEW ARCHITECTURE COMPONENTS:
- SpamDetector Manager: Sophisticated spam detection with Redis state persistence
- Enhanced MessageBuffer: Seamless integration with anti-spam capabilities
- Comprehensive Testing: 37+ anti-spam tests with performance validation
⨠USER EXPERIENCE: Non-programmer friendly anti-spam configuration
- Simple dropdown selections for spam detection types
- Predefined patterns available (no regex knowledge required)
- Clear parameter descriptions with helpful examples
- User-friendly emojis and descriptions throughout the interface