Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

The "Redis Enhanced" node provides advanced interaction capabilities with a Redis database, allowing users to perform a wide range of operations such as retrieving, setting, deleting, and manipulating data stored in Redis. The "Multi Mix Get" operation specifically enables fetching multiple keys at once with automatic detection of their data types (string, hash, list, set), simplifying the retrieval process when working with mixed data types.

This node is beneficial in scenarios where you need to efficiently read multiple Redis keys of different types in one go without manually specifying each key's type. For example, it can be used in caching systems, session management, or real-time analytics where diverse data structures are stored in Redis and need to be fetched simultaneously.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (only shown when key type is "hash").
Keys Key names to get with automatic type detection (space-separated). Example: string_key hash_key list_key set_key

Output

The output is an array of items, each containing a json object with the requested keys as properties. Each key maps to its corresponding value retrieved from Redis, with the node automatically detecting the type of each key and returning the appropriate data structure:

  • String keys return string values.
  • Hash keys return objects representing the hash fields and values.
  • List keys return arrays of list elements.
  • Set keys return arrays of set members.

If a key does not exist or cannot be retrieved, its value will be null.

No binary data output is produced by this operation.

Example output JSON snippet:

{
  "string_key": "some string value",
  "hash_key": {
    "field1": "value1",
    "field2": "value2"
  },
  "list_key": ["item1", "item2", "item3"],
  "set_key": ["member1", "member2"]
}

Dependencies

  • Requires a connection to a Redis server.
  • Needs an API key credential or equivalent authentication configured in n8n for Redis access.
  • Uses the Redis client library internally to communicate with the Redis instance.

Troubleshooting

  • Invalid JSON in value: When setting hash values with JSON enabled, invalid JSON strings will cause errors. Ensure JSON syntax is correct.
  • Key not found: If a requested key does not exist, the output will contain null for that key.
  • Connection issues: Errors related to connecting to Redis usually indicate misconfigured credentials or network problems.
  • Even number of arguments required: For multi-set operations, ensure key-value pairs are provided in pairs; otherwise, an error is thrown.
  • Timeouts or slow responses: Large numbers of keys or complex data structures may increase response time.

To resolve errors, verify credentials, check Redis server availability, and validate input parameters.

Links and References

Discussion