Actions37
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire
- 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 Members
- 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 such as getting, setting, appending, and deleting keys, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. It is designed for scenarios where users need to perform advanced Redis data manipulations within an n8n workflow, such as caching data, managing queues, or implementing atomic operations.
Specifically, the Get Set operation allows you to set a new value for a given key in Redis and simultaneously retrieve the old value stored at that key. This is useful when you want to update a value but also need to know what was previously stored, for example, in cache invalidation or state tracking workflows.
Properties
| Name | Meaning |
|---|---|
| Key | The name of the Redis key to get and set. |
| Value | The new value to set for the specified key. |
| Name | The property name in the output JSON where the old value (the previous value before setting) will be stored. Supports dot-notation for nested properties. |
Additional related property from the provided input properties:
| Name | Meaning |
|---|---|
| Value Is JSON | Whether the value is treated as JSON or as key-value pairs (only relevant if key type is hash). |
Output
The output JSON contains the old value that was stored at the specified key before it was updated with the new value. The old value is assigned to the property specified by the "Name" input parameter. If dot-notation is used in the property name, the old value will be nested accordingly in the output JSON.
Example output structure:
{
"propertyName": "<old_value>"
}
Where "propertyName" is the user-defined property name and <old_value> is the previous value retrieved from Redis.
Dependencies
- Requires a connection to a Redis instance.
- Needs an API key credential or equivalent authentication configured in n8n to connect to Redis.
- Uses the Redis client library internally to communicate with the Redis server.
Troubleshooting
- Connection errors: Ensure the Redis credentials are correctly configured and the Redis server is accessible.
- Invalid key errors: Make sure the key names are valid strings and exist in Redis when expected.
- JSON parsing errors: When retrieving values, if the data is expected to be JSON but is malformed, parsing may fail. Verify the stored data format.
- Operation not supported: Using the wrong operation or incompatible key types may cause errors; verify the operation matches the key type.
- Timeouts or network issues: Network instability can cause failures; check connectivity and Redis server health.