Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

This node, "Redis Enhanced," provides a comprehensive interface to interact with a Redis database. It supports a wide range of Redis operations including string manipulation, list handling, set and sorted set management, hash operations, key scanning, expiration control, Lua script execution, and more.

The "Hash Values" operation specifically retrieves all values stored in a Redis hash data structure under a given hash key. This is useful when you want to fetch all the values associated with fields in a hash without needing the field names themselves.

Common scenarios for this node include:

  • Managing caching layers by storing and retrieving various data types.
  • Implementing message queues or lists using Redis lists.
  • Handling user sessions or configurations stored as hashes.
  • Executing atomic increments or conditional sets for distributed locks.
  • Running Lua scripts for complex Redis transactions.

Practical example for "Hash Values":

  • You have a Redis hash named user:1001 containing fields like name, email, and age. Using the "Hash Values" operation, you can retrieve all these values at once to process user information in your workflow.

Properties

Name Meaning
Hash The name of the Redis hash key from which to retrieve all values.
Value Is JSON Whether the value is expected to be JSON or key-value pairs (only relevant for hash keys).

Note: The "Value Is JSON" property appears in the node but is not directly used in the "Hash Values" operation based on the code; it generally controls how values are parsed or stored for hash-type keys.

Output

The output is an array of items where each item contains a json object structured as follows for the "Hash Values" operation:

{
  "hash": "<hash_name>",
  "values": [ /* array of all values in the hash */ ]
}
  • hash: The name of the hash key queried.
  • values: An array containing all the values stored in the hash fields.

No binary data output is produced by this operation.

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API authentication token or connection details for Redis (host, port, password, etc.).
  • Uses the Redis client library internally to connect and execute commands.
  • No additional external services are required beyond Redis itself.

Troubleshooting

  • Connection errors: If the node cannot connect to Redis, verify that the Redis server is running and reachable with correct credentials.
  • Invalid hash name: Ensure the hash key specified exists in Redis; otherwise, the returned values array will be empty.
  • Permission issues: Redis ACLs or firewall rules might block access; check permissions if operations fail.
  • Malformed input: For other operations involving JSON parsing, invalid JSON strings may cause errors.
  • Timeouts: Long-running commands or network issues may cause timeouts; ensure stable connectivity.

Common error messages:

  • "Key-value pairs must be even number of arguments": Occurs if setting multiple key-value pairs with an odd number of tokens.
  • Redis command errors: Usually indicate incorrect parameters or unavailable keys.

To resolve errors, check the node parameters carefully, validate Redis server status, and review logs for detailed messages.

Links and References

Discussion