🚀 Version 2.0 - Completely rewritten with improved architecture and reliability!
A powerful n8n community node for collecting messages from Redis lists with multiple collection strategies and robust error handling.
- Multiple Collection Strategies: RPOP, LPOP, and LRANGE (peek-only)
- Smart Message Parsing: Automatic JSON parsing with fallback to plain text
- Robust Error Handling: Comprehensive error management and logging
- Debug Mode: Detailed logging for troubleshooting
- Connection Management: Automatic connection cleanup and timeout handling
- Parameter Validation: Input validation with helpful error messages
- Performance Optimized: Efficient Redis operations with minimal overhead
npm install n8n-nodes-redis-collector@2.0.0
- Go to Credentials in your n8n instance
- Create new Redis API credential
- Configure:
- Host: Redis server hostname (default: localhost)
- Port: Redis server port (default: 6379)
- Password: Redis password (if required)
- Database: Redis database number (default: 0)
Parameter | Type | Default | Description |
---|---|---|---|
Thread ID | String | - | Redis list key to collect from |
Max Messages | Number | 10 | Maximum messages to collect (1-100) |
Collection Strategy | Options | pop_right | How to collect messages |
Timeout | Number | 5 | Connection timeout in seconds |
Enable Debug | Boolean | false | Enable detailed logging |
- Use case: LIFO (Last In, First Out) processing
- Behavior: Removes and returns messages from the right end
- Best for: Stack-like operations, newest messages first
- Use case: FIFO (First In, First Out) processing
- Behavior: Removes and returns messages from the left end
- Best for: Queue-like operations, oldest messages first
- Use case: Read-only operations
- Behavior: Reads messages without removing them
- Best for: Monitoring, debugging, non-destructive reads
{
"threadId": "user_messages_123",
"maxMessages": 5,
"strategy": "pop_right",
"timeout": 10,
"enableDebug": true
}
{
"threadId": "task_queue",
"maxMessages": 20,
"strategy": "pop_left",
"timeout": 5,
"enableDebug": false
}
{
"threadId": "system_logs",
"maxMessages": 50,
"strategy": "peek",
"timeout": 3,
"enableDebug": true
}
Each collected message returns:
{
"index": 0,
"threadId": "user_messages_123",
"strategy": "pop_right",
"message": { "parsed": "json" },
"timestamp": "2024-01-15T10:30:00.000Z",
"rawMessage": "{\"parsed\": \"json\"}"
}
- index: Message position in the collected batch
- threadId: Source Redis list key
- strategy: Collection method used
- message: Parsed message (JSON object or plain string)
- timestamp: Collection timestamp (ISO format)
- rawMessage: Original message string from Redis
Enable debug logging to see detailed operation information:
[RedisCollector] Connected to Redis: localhost:6379
[RedisCollector] Target list: user_messages_123
[RedisCollector] Strategy: pop_right, Max messages: 5
[RedisCollector] List length: 12
[RedisCollector] Will collect 5 messages
[RedisCollector] RPOP: {"user":"john","action":"login"}
[RedisCollector] RPOP: {"user":"jane","action":"logout"}
[RedisCollector] Collected 5 messages total
[RedisCollector] Returning 5 processed items
[RedisCollector] Disconnected from Redis
The node provides comprehensive error handling:
- Connection Errors: Timeout and network issues
- Authentication Errors: Invalid credentials
- Parameter Validation: Invalid inputs
- Redis Errors: Server-side issues
All errors include descriptive messages for easy troubleshooting.
- Complete rewrite with modern TypeScript patterns
- Simplified architecture - removed complex execution tracking
- Better error handling with specific error types
- Enhanced debugging with structured logging
- Multiple collection strategies (RPOP, LPOP, LRANGE)
- Automatic JSON parsing with fallback
- Parameter validation with helpful messages
- Connection management with proper cleanup
- Complex execution tracking system
- Wait time parameters (simplified to timeout)
- Lock mechanisms (not needed with new architecture)
- Fallback collection methods (replaced with strategies)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
If you encounter issues:
- Enable debug mode to see detailed logs
- Check Redis connection and credentials
- Verify Redis list exists and has data
- Review n8n logs for additional context
Made with ❤️ for the n8n community