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. The eval operation specifically allows users to execute custom Lua scripts on the Redis server, enabling advanced and flexible data manipulation beyond standard commands.

This node is beneficial in scenarios where complex atomic operations or custom logic need to be executed directly within Redis, such as:

  • Running multi-key transactions or conditional updates atomically.
  • Performing batch processing or computations on Redis data without multiple round-trips.
  • Extending Redis functionality with user-defined Lua scripts for specialized use cases.

For example, a user might write a Lua script to increment multiple keys conditionally or to aggregate values stored across different keys atomically.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (only shown when key type is hash).
Script The Lua script code to execute on the Redis server.
Keys Space-separated list of keys to pass as KEYS to the Lua script.
Arguments Space-separated list of arguments to pass as ARGV to the Lua script.

Output

The output JSON contains a single field:

  • result: The result returned by the executed Lua script. This can be any valid Redis reply type converted appropriately. If the result is a bigint, it is converted to a JavaScript number.

No binary data output is produced by this operation.

Example output JSON:

{
  "result": <value_returned_by_lua_script>
}

Dependencies

  • Requires a Redis server connection configured via an API key credential for authentication.
  • The node uses a Redis client library internally to connect and execute commands.
  • The user must provide valid Lua script code and optionally keys and arguments relevant to that script.

Troubleshooting

  • Common issues:

    • Syntax errors or runtime errors in the Lua script will cause execution failure.
    • Passing incorrect keys or arguments may lead to unexpected results or errors.
    • Large or long-running scripts may impact Redis performance or time out.
  • Error messages:

    • Errors thrown from Redis during script execution will be surfaced with their message.
    • If the input keys or arguments are malformed, the node will throw an error indicating invalid parameters.
  • Resolution tips:

    • Validate Lua script syntax before using it in the node.
    • Test scripts independently in a Redis CLI environment.
    • Use the "continue on fail" option to handle errors gracefully in workflows.

Links and References

Discussion