Actions35
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- Keys
- List Length
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
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.
- Implementing custom caching strategies or counters.
- Performing batch operations that are not natively supported by Redis commands.
- Extending Redis functionality with user-defined Lua scripts.
For example, a user might write a Lua script to increment multiple keys only if certain conditions are met, or to perform complex data transformations 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 to execute on the Redis server. |
| Keys | Space-separated list of keys to pass to the Lua script. |
| Arguments | Space-separated list of arguments to pass 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 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 scripts compatible with Redis's Lua scripting environment.
Troubleshooting
Common issues:
- Syntax errors or runtime errors in the Lua script will cause execution failure.
- Passing incorrect keys or arguments format may lead to unexpected results or errors.
- Connection issues with the Redis server will prevent script execution.
Error messages:
- Errors thrown during script execution will include the error message from Redis or the Lua interpreter.
- If the node is set to continue on fail, errors will be included in the output JSON under an
errorfield. - Ensure the Lua script is valid and tested independently if errors occur.
Resolution tips:
- Validate Lua scripts using Redis CLI or other Redis clients before using them in the node.
- Check Redis server connectivity and credentials.
- Use the "continue on fail" option to handle errors gracefully in workflows.
Links and References
- Redis Lua Scripting Documentation
- Redis Commands Reference
- Lua 5.1 Reference Manual (Redis uses Lua 5.1)