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 operations such as getting, setting, deleting keys, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. It is designed for scenarios where users need to integrate Redis data storage and retrieval into their workflows with enhanced control over data types and operations.
A practical example includes caching API responses by setting keys with expiration, retrieving and updating session data stored in hashes, or managing message queues using list push/pop operations. The "Get Set" operation specifically allows setting a new value for a key while returning its previous value, useful for atomic updates or tracking changes.
Properties
| Name | Meaning |
|---|---|
| Value Is JSON | Whether the value is JSON or key-value pairs (only shown when key type is hash). |
| Key | Name of the Redis key to operate on (required for getset operation). |
| Value | Value to set for the key (required for getset operation). |
| Name | Name of the property in the output JSON where the old value (previous value) will be stored. |
Output
The output JSON contains the old value of the specified Redis key before it was updated with the new value. This old value is stored under the property name defined by the user (default is "propertyName"). The structure supports dot-notation, allowing nested properties to be set in the output JSON object.
Example output JSON if the propertyName is "oldValue":
{
"oldValue": "previous_value_of_key"
}
If the key did not exist before, the old value will typically be null.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key credential or connection details for Redis authentication.
- Uses the Redis client library internally to connect and perform commands.
- No additional external services are required beyond Redis itself.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Errors if the key does not exist or the data type does not match expected operations.
- JSON parsing errors if the stored value is not valid JSON but expected to be parsed.
Error messages:
- Connection errors: Check Redis credentials and network connectivity.
- "Key-value pairs must be even number of arguments": Occurs if input format for multi-set operations is invalid.
- Parsing errors: Ensure that values marked as JSON are correctly formatted.
To resolve errors, verify all input parameters, ensure Redis server availability, and validate data formats.
Links and References
- Redis Official Documentation
- Redis Commands Reference
- n8n Documentation (for general usage of Redis Enhanced node)