Overview
This node interacts with a Redis server to save and collect messages from a Redis list using a locking mechanism to ensure safe concurrent access. It supports two main operation modes:
- Save and Collect: Saves incoming messages into a Redis list, waits for a specified delay, then collects all messages from that list atomically by acquiring a lock. This mode is useful when you want to batch process or aggregate messages arriving over time.
- Collect Only: Simply collects existing messages from the Redis list without saving new input data. Useful for retrieving previously saved messages.
Typical use cases include message queue processing, batching events for downstream workflows, or coordinating distributed processes via Redis lists.
For example, in "Save and Collect" mode, the node can receive multiple event messages, store them temporarily in Redis, wait for a few seconds to accumulate more messages, then retrieve and output all collected messages together as a batch.
Properties
| Name | Meaning |
|---|---|
| Operation Mode | Choose between "Save and Collect" (save incoming messages and then collect all after a delay) or "Collect Only" (only collect existing messages from Redis). |
| Thread ID | The Redis list key used to store and collect messages. Can be auto-extracted from input JSON fields or specified manually. |
| Auto Save Input | (Only for "Save and Collect") Whether to automatically save incoming input data to the Redis list. |
| Collection Delay (seconds) | (Only for "Save and Collect") Time in seconds to wait after saving before collecting messages. Allows accumulation of messages before retrieval. |
| Lock TTL (seconds) | Time-to-live for the Redis lock key in seconds. Controls how long the lock is held to prevent concurrent collection. |
| Connection Timeout (seconds) | Timeout in seconds for connecting to the Redis server. |
| Content Path | (Only for "Save and Collect") JSONPath expression to extract specific content from each input message before saving. If empty, saves the full input object. Examples: "message.data.content", "message.data". |
| Output Mode | How to format the output data: ⢠Full Output: summary object plus all message objects ⢠Messages Only: only the message objects ⢠Content Only: only the extracted message content as a simple array |
| Enable Debug Logging | Enable detailed debug logging for troubleshooting and insight into internal operations. |
Output
The node outputs an array of items depending on the selected output mode:
- Full Output: An array starting with a summary object containing metadata (
threadId,operation,messageCount,timestamp), followed by individual message objects representing each collected message. - Messages Only: An array of message objects, each containing the JSON-parsed message data collected from Redis.
- Content Only: A simple array of the extracted content from each message (based on the
contentPath), without any wrapping metadata.
If the node operates in "Collect Only" mode, it similarly outputs the collected messages or content but does not save new input data.
The node does not output binary data.
Dependencies
- Requires a running Redis server accessible with provided host, port, optional password, and database index.
- Needs credentials configured in n8n for connecting to Redis (host, port, password, database).
- Uses the official Redis client library for Node.js.
- No additional external services are required.
Troubleshooting
- Missing Thread ID: The node requires a non-empty thread ID (Redis list key). Ensure this is correctly set or auto-extracted from input data.
- Redis Connection Issues: Errors connecting to Redis may occur if credentials are incorrect, Redis is unreachable, or connection timeout is too low. Verify Redis server availability and credential correctness.
- Lock Acquisition Failures: If the node cannot acquire the lock, it means another instance is currently collecting messages. This is expected behavior to avoid race conditions. The node will skip collection in this case.
- Message Parsing Errors: If stored messages are corrupted or not valid JSON, parsing errors may occur during collection. Ensure only valid JSON strings are pushed to the Redis list.
- Timeouts and Delays: Setting very short collection delays or lock TTLs may cause premature lock expiration or incomplete message collection. Adjust these values according to your workload.
- Debug Logging: Enable debug logging to get detailed insights into each step, including connection status, lock attempts, message counts, and errors.
Common error messages include:
"Thread ID is required": Set a valid thread ID."Redis credentials are required": Configure Redis credentials in n8n."Redis Collector operation failed: ...": General failure; check inner error details and Redis connectivity.