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 including key management, data retrieval, and manipulation of various Redis data types such as strings, hashes, lists, sets, and sorted sets. The "Hash Exists" operation specifically checks whether a particular field exists within a given hash stored in Redis.

This node is beneficial in scenarios where workflows need to verify the presence of specific data fields inside Redis hashes before proceeding with further processing or conditional logic. For example, it can be used to check if a user profile attribute exists in a cached hash or to validate configuration settings stored as hash fields.

Practical example:

  • Before updating a user's email address stored in a Redis hash, use the "Hash Exists" operation to confirm that the email field is present.
  • In caching scenarios, verify if a certain cache entry field exists to decide whether to refresh or reuse cached data.

Properties

Name Meaning
Value Is JSON Whether the value is JSON or key-value pairs (boolean). Relevant when working with hashes.
Hash Name of the Redis hash to operate on (string). Required for hash-related operations.
Field Name of the field within the hash to check for existence (string). Required for "Hash Exists".

Output

The output JSON object for the "Hash Exists" operation contains:

  • hash: The name of the hash checked.
  • field: The field name checked within the hash.
  • exists: A boolean indicating whether the specified field exists (true) or not (false).

Example output JSON:

{
  "hash": "user:1234",
  "field": "email",
  "exists": true
}

No binary data output is produced by this operation.

Dependencies

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

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Specifying a non-existent hash or field will simply return exists: false without error.
    • Providing empty or invalid hash or field names will cause errors.
  • Error messages:

    • Connection errors: Indicate problems with Redis server availability or credentials. Verify connection details and network access.
    • Invalid parameters: Errors thrown if required properties like "Hash" or "Field" are missing or empty. Ensure these inputs are correctly provided.
    • Unexpected Redis errors: May occur if Redis server is misconfigured or commands fail; review Redis logs and node error messages.
  • To handle errors gracefully, enable the node's "Continue On Fail" option to allow workflow execution to proceed even if some items fail.

Links and References

Discussion