Actions41
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Get
- Hash Keys
- Hash Length
- Hash Set
- Hash Values
- Increment
- Info
- Keys
- List Length
- List Range
- Multi Get
- Multi Hash Get
- Multi Mix Get
- Multi Mix Set
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
Overview
The node "Redis Enhanced" provides a comprehensive interface to interact with a Redis database, supporting a wide range of Redis operations. It allows users to get, set, update, and delete data in Redis with enhanced capabilities beyond basic commands. This includes working with strings, hashes, lists, sets, sorted sets, executing Lua scripts, scanning keys, and managing key expiration.
A common use case for this node is integrating Redis as a caching layer or message broker within an n8n workflow. For example, you can retrieve a range of elements from a Redis list to process batch data, increment counters atomically, or publish messages to Redis channels for real-time notifications.
Specifically, the "List Range" operation fetches a specified range of elements from a Redis list, which is useful when you want to read a subset of list items without retrieving the entire list. This can be applied in scenarios like paginating cached data or processing queued tasks in chunks.
Properties
| Name | Meaning |
|---|---|
| List | The name of the Redis list from which to retrieve elements. |
| Start Index | The zero-based start index of the range to retrieve. Negative values count from the end. |
| Stop Index | The inclusive stop index of the range. Use -1 to indicate the last element in the list. |
Output
The output JSON contains the following structure:
{
"list": "name_of_the_list",
"start": start_index,
"stop": stop_index,
"elements": [
"element1",
"element2",
"...",
"elementN"
]
}
list: The name of the Redis list queried.start: The start index used for the range query.stop: The stop index used for the range query.elements: An array of string elements retrieved from the list within the specified range.
This output provides the exact subset of list elements requested, allowing downstream nodes to process or analyze these items.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key credential or connection details for Redis authentication.
- Uses the official Redis client library for Node.js internally.
- No additional external services are required beyond Redis itself.
Troubleshooting
- Connection Issues: If the node cannot connect to Redis, verify that the Redis server is running, reachable, and credentials are correct.
- Invalid List Name: Providing an empty or non-existent list name will result in an error or empty results.
- Index Out of Range: Using invalid start or stop indices may return empty arrays or unexpected results; ensure indices are within the list bounds.
- Permission Errors: Ensure the Redis user has permissions to perform the LRANGE command on the specified list.
- JSON Parsing Errors: Although not directly applicable to "List Range", other operations involving JSON parsing may fail if the stored data is malformed.
If errors occur, enabling "Continue On Fail" in the node settings allows the workflow to proceed while capturing error details in the output.