Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

This node, named "Redis Enhanced," provides a comprehensive interface to interact with a Redis database. It supports a wide range of Redis operations such as getting and setting keys, manipulating lists, sets, sorted sets, hashes, executing Lua scripts, and more. The node is useful for scenarios where you need to integrate Redis data storage or caching into your workflows, enabling you to read, write, update, and manage Redis data directly within n8n.

For example, you can use this node to:

  • Retrieve the length of a string stored in Redis.
  • Append data to an existing Redis string key.
  • Get or set values in various Redis data types (strings, hashes, lists).
  • Execute Lua scripts for advanced Redis operations.
  • Manage expiration times on keys.
  • Publish messages to Redis channels for real-time messaging.

The "String Length" operation specifically returns the length of the string value stored at a given Redis key.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (only shown when key type is hash).
Key Name of the key in Redis to operate on (required for String Length and related operations).

Note: The provided properties are partial and specific to the "String Length" operation and related key handling. The full node supports many other properties depending on the selected operation.

Output

The output of the "String Length" operation is a JSON object containing:

  • key: The Redis key name queried.
  • length: The length of the string stored at that key.

Example output JSON:

{
  "key": "myStringKey",
  "length": 42
}

If the key does not exist or is not a string, the length will typically be zero or the operation may return null depending on Redis behavior.

The node does not output binary data.

Dependencies

  • Requires a Redis server connection.
  • Requires an API key credential or authentication token configured in n8n to connect to Redis.
  • Uses the Redis client library internally to communicate with the Redis instance.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Errors if the key does not exist or is of a different type than expected.
    • Invalid input parameters such as missing required keys.
  • Error messages:

    • Connection errors will indicate inability to connect or authenticate with Redis.
    • If key-value pairs are malformed (in multi-set operations), an error about even number of arguments is thrown.
    • For the "String Length" operation, if the key is missing or empty, an error indicating the key is required will occur.
  • Resolutions:

    • Verify Redis credentials and network connectivity.
    • Ensure the key exists and is of string type before calling string-specific operations.
    • Provide all required parameters correctly.

Links and References

Discussion