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, hashes, sorted sets, and executing Lua scripts. The "Get" operation specifically retrieves the value of a specified key from Redis, supporting different data types (string, hash, list, set) and allows storing the retrieved data into a custom property in the workflow's JSON output.
This node is beneficial in scenarios where workflows need to read cached or shared data stored in Redis, such as fetching user session data, configuration settings, counters, or any other stateful information managed via Redis. For example, you can use it to retrieve a user's profile stored as a hash or get a list of recent events stored in a Redis list.
Properties
| Name | Meaning |
|---|---|
| Name | The name of the property in the output JSON where the retrieved Redis data will be stored. Supports dot-notation for nested properties (e.g., "data.person[0].name"). |
| Key | The Redis key whose value you want to retrieve. |
| Key Type | The type of the Redis key to get. Options: - Automatic: Detects the key type before retrieving data (slower). - Hash: The key stores a hash. - List: The key stores a list. - Sets: The key stores a set. - String: The key stores a string. |
| Options | Additional options for the get operation: - Dot Notation (boolean): Whether to use dot-notation when writing the property name. If false, the property name is used literally without nesting. |
| Value Is JSON | (Only shown if Key Type is "Hash") Whether the hash values are JSON strings or simple key-value pairs. Defaults to true. |
Output
The output JSON contains the retrieved value from Redis stored under the property name specified by the "Name" input property. The structure depends on the key type:
- For String keys: The value is a string.
- For Hash keys: The value is an object representing the hash fields and their values. If "Value Is JSON" is true, values are parsed as JSON.
- For List keys: The value is an array of list elements.
- For Sets keys: The value is an array of set members.
If dot-notation is enabled, the property name supports nested paths, so the data will be nested accordingly in the output JSON.
Example output snippet if propertyName is "user.profile" and the key holds a hash:
{
"user": {
"profile": {
"name": "John",
"age": 30
}
}
}
Dependencies
- Requires a Redis server accessible with valid 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 operations.
Troubleshooting
- Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Specifying a wrong key or key type may result in empty or unexpected results.
- Parsing errors if "Value Is JSON" is true but the stored data is not valid JSON.
- Error messages:
- Errors during connection or command execution will be thrown as node errors.
- If "Continue On Fail" is enabled, errors for individual items will be returned in the output JSON under an
errorproperty.
- Resolutions:
- Verify Redis credentials and network connectivity.
- Ensure the key exists and matches the specified key type.
- Disable "Value Is JSON" if the data is plain strings to avoid parsing errors.