Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

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. It is designed for users who want enhanced control over Redis data within their n8n workflows.

For the Get operation specifically, the node retrieves the value of a specified key from Redis. It supports different Redis data types (string, hash, list, set) and can automatically detect the type or use a user-specified type. The retrieved data is then written into the workflow's JSON output under a user-defined property name, supporting dot-notation for nested structures.

Common scenarios:

  • Fetching cached data stored in Redis to use in subsequent workflow steps.
  • Retrieving user session information or configuration stored as hashes or strings.
  • Accessing elements from Redis lists or sets for processing.
  • Integrating Redis data retrieval seamlessly into automation pipelines.

Example:

  • Get the string value of key user:1234:name and store it in the workflow data at user.name.
  • Retrieve all fields of a hash key session:abcd and write them under sessionData.

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" stores the value deeply nested.
Key The Redis key whose value you want to get.
Key Type The type of the Redis key to get. Options:
- Automatic: Detects the 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 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 that should be parsed into objects, or simple key-value pairs. Defaults to true.

Output

The output is an array of items, each containing a json object. For the Get operation, the json object includes the retrieved Redis data stored under the user-defined property name.

  • If dot-notation is enabled, the property name like "a.b" results in nested JSON { "a": { "b": value } }.
  • If dot-notation is disabled, the property name is used as a flat key, e.g., { "a.b": value }.
  • The value corresponds to the Redis key's content, which can be:
    • A string value.
    • An object representing a hash.
    • An array for lists or sets.
    • Parsed JSON objects if applicable (especially for hash values when Value Is JSON is true).

No binary data output is produced by this operation.

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API key or authentication token credential for Redis connection.
  • Uses the Redis client library internally to communicate with Redis.
  • No additional external services are required beyond Redis itself.

Troubleshooting

  • Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
  • Key not found: If the specified key does not exist, the output value will be null.
  • Type mismatch: If the key type is incorrectly specified, the returned data may be empty or cause errors. Use "Automatic" type detection if unsure.
  • JSON parsing errors: When Value Is JSON is true but the hash values are not valid JSON, parsing will fail. Disable this option or ensure values are valid JSON strings.
  • Dot notation issues: If the property name contains dots but you want a flat key, disable dot-notation in options to avoid unexpected nested objects.

Common error messages come from Redis client failures or invalid parameters and are surfaced clearly. Using the "Continue on Fail" option allows workflows to proceed despite individual item errors.

Links and References

Discussion