Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

The "Redis Enhanced" node provides a comprehensive interface to interact with a Redis database, supporting a wide range of operations on different Redis data types such as strings, hashes, lists, sets, and sorted sets. The node allows users to perform common Redis commands like getting and setting keys, manipulating hashes, publishing messages, scanning keys, and more.

The "Hash Keys" operation specifically retrieves all the field names (keys) stored within a given Redis hash. This is useful when you want to inspect or enumerate the fields inside a hash without retrieving their values.

Common scenarios:

  • Inspecting the structure of a Redis hash to understand what fields it contains.
  • Dynamically processing or iterating over all fields in a hash for further operations.
  • Debugging or auditing Redis data by listing hash keys.

Practical example:
You have a Redis hash named user:1001 that stores user profile fields like name, email, and age. Using the "Hash Keys" operation, you can retrieve the list ["name", "email", "age"] to know which fields are available for that user.

Properties

Name Meaning
Hash The name of the Redis hash from which to retrieve all field names.

Note: The property "Value Is JSON" exists but is not relevant for the "Hash Keys" operation.

Output

The output is an array of items where each item contains a json object with the following structure:

{
  "hash": "name_of_the_hash",
  "keys": ["field1", "field2", "field3", ...]
}
  • hash: The name of the Redis hash queried.
  • keys: An array of strings representing all the field names present in the specified hash.

This output allows downstream nodes or workflows to access the list of fields for further processing.

Dependencies

  • Requires a connection to a Redis instance.
  • Needs an API key credential or equivalent authentication configured in n8n to connect securely to Redis.
  • The node uses the Redis client library internally to communicate with the Redis server.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Specifying a non-existent hash name will return an empty list of keys.
    • Permission errors if the Redis user does not have access to the requested hash.
  • Error messages:

    • Errors related to connection or authentication will be thrown if the Redis server cannot be reached or credentials are invalid.
    • If the hash name parameter is missing or empty, the node may throw an error indicating a required parameter is missing.
    • JSON parsing errors do not apply to this operation since it only returns keys.
  • Resolutions:

    • Verify Redis credentials and network connectivity.
    • Ensure the hash name is correctly specified.
    • Check Redis user permissions for accessing the hash.

Links and References

Discussion