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 operations including data retrieval, modification, and management. Specifically, the Eval operation 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.
  • Implementing custom caching strategies or counters.
  • Performing batch operations that are not natively supported by Redis commands.

For example, a user might write a Lua script to increment multiple keys only if certain conditions are met, ensuring atomicity and consistency without multiple round-trips between the client and Redis.

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 Redis 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 response 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": <script execution result>
}

Dependencies

  • Requires a connection to a Redis instance configured via an API key credential or equivalent authentication method.
  • The node uses a Redis client library internally to connect and communicate with Redis.
  • No additional external services are required beyond the Redis server itself.

Troubleshooting

  • Common issues:

    • Syntax errors or runtime errors in the Lua script will cause the node to throw an error.
    • Passing incorrect keys or arguments format may lead to unexpected results or errors.
    • Large or long-running scripts may time out depending on Redis server configuration.
  • Error messages:

    • Errors from Redis during script execution will be surfaced with their message. For example, "ERR Error running script" indicates a problem inside the Lua script.
    • If the number of keys or arguments is malformed, the node may throw an error indicating invalid input.
  • Resolution tips:

    • Validate Lua script syntax before use.
    • Ensure keys and arguments are space-separated strings without extra whitespace.
    • Use Redis CLI or other tools to test scripts independently.
    • Enable "Continue On Fail" option in the node to handle errors gracefully in workflows.

Links and References

Discussion