Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

This node, "Redis Enhanced," provides a comprehensive interface to interact with a Redis database. It supports a wide range of Redis operations such as retrieving keys, setting values, incrementing counters, managing lists, sets, sorted sets, hashes, and executing Lua scripts. The "Keys" operation specifically allows users to retrieve all keys matching a given pattern, optionally fetching their associated values.

Common scenarios where this node is beneficial include:

  • Managing cache data by retrieving or updating keys.
  • Monitoring keys that match certain patterns for analytics or debugging.
  • Bulk retrieval of keys and their values for data migration or backup.
  • Executing complex Redis commands or Lua scripts for advanced workflows.

Practical example:

  • Retrieve all keys starting with "user:" and get their values to process user session data.
  • Scan keys matching "order:*" to analyze order statuses in an e-commerce system.

Properties

Name Meaning
Key Pattern The pattern used to match keys in Redis (e.g., user:* to match all keys starting with "user:").
Get Values Whether to fetch the values of the matched keys (true to get values, false to only get keys).
Value Is JSON (Shown only if key type is "hash") Indicates whether the hash value is stored as JSON or as key-value pairs.

Output

The output is an array of JSON objects, each representing the result of processing one input item.

For the "Keys" operation:

  • If Get Values is false, the output JSON contains a single property keys which is an array of strings representing the matched keys.
  • If Get Values is true, the output JSON contains properties named after each matched key, with their corresponding values fetched from Redis. The values are retrieved according to their Redis data types and may be parsed JSON or raw strings depending on the key type.

No binary data output is produced by this operation.

Example output when getting values:

{
  "user:1": { "name": "Alice", "age": 30 },
  "user:2": { "name": "Bob", "age": 25 }
}

Example output when not getting values:

{
  "keys": ["user:1", "user:2", "user:3"]
}

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API key or authentication token for Redis connection (configured as credentials in n8n).
  • Uses the Redis client library internally to connect and execute commands.
  • No additional external services are required beyond Redis itself.

Troubleshooting

  • Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
  • Empty results: Verify the key pattern matches existing keys; patterns use Redis glob-style syntax.
  • Performance issues: Fetching values for many keys can be slow; consider disabling "Get Values" if only keys are needed.
  • Parsing errors: If values are expected to be JSON but are malformed, parsing will fail silently and return raw strings.
  • Error messages: Common errors include invalid key patterns, permission denied, or command timeouts. Check Redis server logs and credentials.

Links and References

Discussion