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, and delete data in Redis with enhanced capabilities beyond basic commands. This node is beneficial for scenarios where you need to integrate Redis caching, messaging, or data storage into your workflows, such as:

  • Managing sets, sorted sets, hashes, lists, and strings in Redis.
  • Performing atomic increments or conditional key setting.
  • Executing Lua scripts on the Redis server.
  • Publishing messages to Redis channels for real-time communication.
  • Scanning keys incrementally for production-safe key iteration.

For example, you could use this node to add members to a Redis set, check if a member exists, retrieve the cardinality of a set, or execute a custom Lua script to perform complex operations atomically.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (only shown when key type is hash).
Set Name of the Redis set to operate on (used in set-related operations like sadd, srem, sismember, scard).

Note: These properties are specific to the "Set Cardinality" operation and related set operations. The node supports many other properties depending on the selected operation, but only these are relevant here.

Output

The output JSON structure depends on the operation performed. For the "Set Cardinality" (scard) operation, the output JSON includes:

  • set: The name of the Redis set queried.
  • cardinality: The number of members in the specified set.

Example output JSON for "Set Cardinality":

{
  "set": "mySet",
  "cardinality": 42
}

This indicates that the set named "mySet" contains 42 members.

If the node outputs binary data (not applicable for "Set Cardinality"), it would represent raw binary content from Redis keys.

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API authentication token or connection credentials for Redis (configured generically as "an API key credential").
  • Uses the Redis client library internally to connect and execute commands.
  • No additional external services are required.

Troubleshooting

  • Connection Issues: If the node cannot connect to Redis, verify the Redis server address, port, and authentication credentials.
  • Invalid Key or Set Names: Ensure the set name provided is correct and exists in Redis.
  • Operation Errors: Errors during execution (e.g., malformed input, wrong data types) will throw exceptions. Enable "Continue On Fail" to handle errors gracefully.
  • Key-Value Pair Format: For operations requiring multiple key-value pairs, ensure the input string has an even number of arguments separated by spaces.
  • Timeouts: Long-running operations may time out; adjust Redis server settings or workflow timeouts accordingly.

Common error message example:

  • "Score-member pairs must be even number of arguments": Indicates incorrect formatting of score-member inputs for sorted set operations. Fix by providing pairs correctly.

Links and References

Discussion