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 "Redis Enhanced" node provides a comprehensive interface to interact with a Redis database, supporting a wide range of operations including string manipulation, list handling, set and sorted set management, hash operations, key scanning, and Lua script execution. It is designed for users who want to perform advanced Redis commands within n8n workflows without writing custom code.
This node is beneficial in scenarios such as caching data, managing real-time messaging queues, maintaining sets or sorted sets for leaderboards, performing atomic increments, or running Lua scripts for complex transactions.
For example:
- Adding members to a Redis set to track active users.
- Incrementing counters atomically for analytics.
- Publishing messages to Redis channels for event-driven architectures.
- Executing Lua scripts to perform multi-key operations atomically.
Properties
| Name | Meaning |
|---|---|
| Operation | The Redis command to execute. Options include: Append, Blocking Pop Left/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. |
| Value Is JSON | (Shown when key type is hash) Whether the value is JSON or key-value pairs. |
| Set | (For set operations like sadd, srem, sismember, scard) Name of the Redis set. |
| Members | (For sadd, srem) Space-separated list of members to add or remove from the set. |
Additional properties are dynamically shown depending on the selected operation, such as:
- Key, Key Type, Value, Expire, TTL for string or hash operations.
- List name and message data for list push/pop operations.
- Channel and message data for publish operation.
- Script, keys, and arguments for eval operation.
- Various parameters for sorted sets and hashes.
Output
The output is an array of JSON objects representing the result of each input item processed. The structure varies by operation but generally includes:
- For set operations (
sadd,srem):{ set: <setName>, added/removed: <number>, members: [<members>] } - For membership check (
sismember):{ set: <setName>, member: <member>, isMember: <boolean> } - For cardinality (
scard):{ set: <setName>, cardinality: <number> } - For other operations, outputs contain relevant fields such as keys, values, lengths, results, or error messages if any occur.
- When retrieving data, the node supports dot-notation to place data into nested JSON properties.
No binary data output is produced by this node.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key or authentication token credential for Redis connection.
- Uses the Redis client library internally to communicate with the Redis instance.
Troubleshooting
- Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
- Invalid key or member names: Provide valid strings; empty or malformed inputs may cause errors.
- Key-value pairs mismatch in mset: The number of arguments must be even; otherwise, an error is thrown.
- Lua script errors: Syntax or runtime errors in provided Lua scripts will cause execution failure.
- Operation not supported: Selecting an unsupported operation or missing required parameters will throw errors.
- Use the "Continue On Fail" option to handle errors gracefully in batch processing.