Overview
This node interacts with a Redis database to perform various operations on data stored in Redis. Specifically, the "Push" operation allows users to add data to a Redis list either at the head (start) or tail (end) of the list. This is useful for queue management, caching, or any scenario where ordered data storage and retrieval are needed.
Practical examples include:
- Adding new tasks to a job queue.
- Storing recent user actions in a session list.
- Appending log entries or messages to a list for later processing.
Properties
| Name | Meaning |
|---|---|
| List | The name of the Redis list to which data will be pushed. |
| Data | The actual data string to push onto the list. |
| Tail | Boolean flag indicating whether to push data to the end (tail) of the list (true) or the start (head) (false). |
| Value Is JSON | (Shown only if key type is "hash") Indicates whether the value is JSON or key-value pairs. |
Output
The output is an array of items corresponding to each input item processed. For the "Push" operation, the output JSON is essentially the same as the input item, meaning it passes through the original data without modification.
No binary data is output by this operation.
Dependencies
- Requires a connection to a Redis server.
- Needs valid Redis credentials configured in n8n.
- Uses Redis client methods such as
lPushandrPushto interact with lists.
Troubleshooting
- Connection issues: Ensure that the Redis server is reachable and credentials are correct.
- Invalid list name: The "List" property must be a valid Redis list key; otherwise, the operation may fail silently or cause errors.
- Data format: Although the node accepts string data, pushing complex objects requires serialization (e.g., JSON.stringify) before pushing.
- Tail flag confusion: Setting the "Tail" property incorrectly may result in data being added to the wrong end of the list.
Common error messages:
- Connection errors related to authentication or network issues.
- Errors thrown if Redis commands fail due to invalid keys or server problems.
To resolve errors:
- Verify Redis server status and credentials.
- Check that the list name is correct and accessible.
- Confirm that the data format matches expectations.
Links and References
- Redis Lists Documentation
- n8n Redis Node Documentation (for general Redis usage in n8n)