Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

The "Redis Enhanced" node provides a comprehensive interface to interact with a Redis database, supporting a wide range of operations such as checking key existence, setting and getting values, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. The "Exists" operation specifically checks whether one or more specified keys exist in the Redis store.

This node is beneficial in scenarios where workflows need to verify the presence of certain data before proceeding, such as conditional branching based on cache availability, validating configuration keys, or ensuring prerequisites are met in distributed systems.

Example use case:
Before attempting to retrieve user session data from Redis, the workflow can use the "Exists" operation to check if the session keys are present, avoiding unnecessary fetch attempts and handling missing sessions gracefully.

Properties

Name Meaning
Keys Space-separated list of key names to check for existence (e.g., key1 key2 key3).
Value Is JSON (Shown only if key type is "hash") Boolean indicating whether the value is JSON or key-value pairs.

Output

The output JSON object contains:

  • exists: A number representing how many of the specified keys exist in Redis.
  • keys: An array of the keys that were checked.

Example output:

{
  "exists": 2,
  "keys": ["key1", "key2", "key3"]
}

This indicates that out of the three keys checked, two exist in the Redis database.

Dependencies

  • Requires a Redis server connection configured via an API key credential.
  • The node uses a Redis client library internally to communicate with the Redis instance.
  • Proper Redis credentials must be set up in n8n for authentication.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Specifying keys incorrectly (e.g., empty string or invalid characters) may lead to unexpected results.
    • If no keys are provided, the operation will not perform any meaningful check.
  • Error messages:

    • Errors related to Redis connectivity will typically indicate failure to connect or authenticate. Verify credentials and network access.
    • If the node throws an error about key format or parameters, ensure keys are space-separated and non-empty.
    • When using "continue on fail," errors will be returned in the output JSON under an error property for each failed item.

Links and References

Discussion