Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

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, delete, and manipulate data stored in Redis keys of various types such as strings, lists, hashes, sets, and sorted sets. The node is useful for scenarios where you need to integrate Redis caching, messaging, or data storage into your workflows.

For the List Range operation specifically, the node retrieves a specified range of elements from a Redis list key. This is beneficial when you want to fetch a subset of list items, for example, retrieving recent messages, paginating through a list of tasks, or processing batches of queued jobs.

Practical Example

  • Fetching the last 10 entries from a Redis list that stores user activity logs.
  • Retrieving a page of items from a task queue stored as a Redis list for batch processing.

Properties

Name Meaning
List The name of the Redis list key 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 to retrieve. Use -1 to indicate the last element.

Output

The output JSON object for the List Range operation contains the following fields:

  • 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 containing the elements retrieved from the list within the specified range.

Example output:

{
  "list": "myList",
  "start": 0,
  "stop": 9,
  "elements": ["item1", "item2", "item3", "..."]
}

The node does not output binary data for this operation.

Dependencies

  • Requires a Redis server connection configured via an API key credential (generic Redis authentication).
  • The node uses a Redis client library internally to communicate with the Redis instance.
  • The Redis server must be accessible from the n8n environment.

Troubleshooting

  • Connection errors: Ensure the Redis server credentials are correct and the server is reachable.
  • Invalid range indices: If the start or stop indices are out of bounds, Redis will return an empty array or fewer elements than expected.
  • Empty list: If the specified list does not exist or is empty, the elements array will be empty.
  • Permission issues: Make sure the Redis user has permission to read the specified list key.
  • Malformed input: Providing non-string list names or invalid numeric indices may cause errors.

Common error message example:

  • "ERR no such key": The specified list key does not exist in Redis.
  • "NodeOperationError" with details about invalid parameters or Redis command failures.

To resolve errors, verify the input parameters, Redis server status, and credentials.

Links and References

Discussion