Actions41
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Get
- Hash Keys
- Hash Length
- Hash Set
- Hash Values
- Increment
- Info
- Keys
- List Length
- List Range
- Multi Get
- Multi Hash Get
- Multi Mix Get
- Multi Mix Set
- 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 automatic type detection.
This node is beneficial in scenarios where workflows need to read cached data, configuration, or state stored in Redis. For example, it can be used to fetch user session data stored as hashes, retrieve messages from lists, or get simple string values for feature flags.
Practical examples:
- Fetching a user's profile information stored as a Redis hash.
- Retrieving the latest messages from a Redis list.
- Getting a configuration value stored as a string key.
Properties
| Name | Meaning |
|---|---|
| Name | The property name in the output JSON where the retrieved data will be stored. Supports dot-notation to create nested objects. Example: "data.person[0].name" |
| Key | The Redis key to retrieve data from. |
| Key Type | The type of the Redis key to get. Options: - Automatic: Detects the key type before fetching (slower). - Hash: Data is a Redis hash. - List: Data is a Redis list. - Sets: Data is a Redis set. - String: Data is a Redis string. |
| Options | Additional options for the get operation: - Dot Notation (boolean): Whether to use dot-notation when writing the output property. If false, the property name is used literally without nesting. |
| Value Is JSON | (Only shown if Key Type is "hash") Whether the hash field values are JSON strings that should be parsed into objects, or treated as plain 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. If dot-notation is enabled, nested objects are created accordingly.
- For string keys, the value is returned as a string or null if not found.
- For hash keys, the entire hash or specific fields are returned as an object, optionally parsing JSON values.
- For list keys, the list elements are returned as an array.
- For set keys, the members are returned as an array.
- If the key does not exist, the value will be
null.
No binary data output is produced by this operation.
Example output snippet (assuming dot-notation and propertyName = "user.profile"):
{
"user": {
"profile": {
"name": "John",
"age": 30
}
}
}
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key or authentication token credential for connecting to Redis.
- Uses the Redis client library internally to perform commands.
- No additional external services are required.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Key not found returns
null— ensure the key exists in Redis. - JSON parsing errors if "Value Is JSON" is enabled but the stored value is not valid JSON.
- Performance impact when using "Automatic" key type detection on large datasets.
Error messages:
- Errors related to invalid JSON in hash values will indicate the parsing failure; verify the stored data format.
- If the key-value pairs count is uneven in multi-set operations (not applicable here but relevant for other ops), an error is thrown.
- Redis command errors (e.g., wrong data type for operation) will be surfaced; check the key type matches the operation.
Resolutions:
- Verify Redis connection settings and credentials.
- Confirm the key exists and matches the expected type.
- Disable "Value Is JSON" if values are plain strings.
- Use explicit key type instead of "Automatic" for better performance and reliability.
Links and References
- Redis Official Documentation
- Redis Data Types
- n8n Documentation on Credentials
- Lua Scripting in Redis (relevant for other operations)