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, executing Lua scripts, and more. 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 session tokens, or ensuring prerequisite data exists in Redis before performing further actions.

Example use case:
Before attempting to retrieve user session data, the workflow can use the "Exists" operation to check if the session keys are present in Redis, avoiding unnecessary errors or handling missing data gracefully.

Properties

Name Meaning
Keys Space-separated list of key names to check for existence in Redis (e.g., key1 key2).
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"]
}

This allows downstream nodes to easily determine which keys are available and how many matched.

Dependencies

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

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Specifying keys that do not exist will result in exists count being zero but no error.
    • Providing empty or improperly formatted keys string may cause unexpected results or errors.
  • Error messages:

    • Errors related to Redis connectivity or command execution will be thrown unless "Continue On Fail" is enabled.
    • If the keys parameter is empty or invalid, the node might throw an error indicating missing required parameters.
  • Resolution tips:

    • Verify Redis credentials and network accessibility.
    • Ensure keys are provided as space-separated strings without extra whitespace.
    • Use "Continue On Fail" option to handle errors gracefully within workflows.

Links and References

Discussion