Overview
This node interacts with a Redis database to perform various operations such as retrieving, setting, deleting keys, and manipulating data structures like hashes, lists, and sets. The "Get" operation specifically fetches the value of a specified key from Redis, supporting different Redis data types (string, hash, list, sets) and allowing flexible output placement using dot-notation in the output JSON.
Common scenarios for this node include:
- Retrieving cached data stored in Redis for use in workflows.
- Accessing specific fields within Redis hashes or elements in lists/sets.
- Integrating Redis-stored configuration or session data into automation processes.
Practical example:
- Fetching user session details stored as a Redis hash and mapping them into structured JSON properties for further processing in an n8n workflow.
Properties
| Name | Meaning |
|---|---|
| Name | The property name where the retrieved Redis data will be written in the output JSON. Supports dot-notation to nest values inside objects (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 fetching (slower). - Hash: Data is a Redis hash. - List: Data is a Redis list. - Sets: Data is a Redis set. - String: Data is a simple 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 values are JSON strings or simple key-value pairs. Defaults to true. |
Output
The output JSON contains the data fetched from Redis under the property name specified by the "Name" input. If dot-notation is enabled, nested objects are created accordingly.
For example, if the property name is "user.details.name" and the retrieved value is "John", the output JSON will be:
{
"user": {
"details": {
"name": "John"
}
}
}
If dot-notation is disabled, the output would be:
{
"user.details.name": "John"
}
The node does not output binary data for the "Get" operation.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key or authentication token for connecting to Redis (configured as credentials in n8n).
- Uses the Redis client library internally to communicate with the Redis instance.
Troubleshooting
- Connection errors: Ensure the Redis credentials are correct and the Redis server is reachable from the n8n environment.
- Key not found: If the specified key does not exist, the output property will be set to
null. - Incorrect key type: Selecting the wrong "Key Type" may cause unexpected results or errors. Use "Automatic" if unsure, but note it is slower.
- JSON parsing errors: When "Value Is JSON" is enabled for hash types, invalid JSON stored in Redis can cause parsing failures. Verify that stored values are valid JSON strings.
- Dot notation issues: If the output property name includes dots but dot-notation is disabled, the data will be nested incorrectly or appear as a single property string. Enable dot-notation unless literal property names are required.