Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

The node "Redis Enhanced" provides a comprehensive interface to interact with a Redis database, supporting a wide range of Redis operations. It allows users to get, set, update, and delete data in Redis, as well as perform advanced operations on sets, sorted sets, hashes, lists, and strings. This node is beneficial for workflows that require caching, real-time data processing, message publishing, or managing complex data structures in Redis.

For the Set Remove operation specifically, the node removes one or more members from a specified Redis set. This is useful when you want to dynamically manage membership of sets, such as removing users from a group, deleting tags from an item, or cleaning up entries in a collection.

Practical example:

  • Removing specific user IDs from a Redis set representing active users.
  • Cleaning up expired session tokens stored as members in a Redis set.

Properties

Name Meaning
Set The name of the Redis set from which members will be removed.
Members Space-separated list of members to remove from the set (e.g., "member1 member2").
Value Is JSON Whether the value is JSON or key-value pairs (only relevant if key type is hash).

Note: For the Set Remove operation, only the "Set", "Members", and "Value Is JSON" properties are relevant based on the provided input properties and source code.

Output

The output is an array of JSON objects, each corresponding to an input item processed. For the Set Remove operation, each output JSON object contains:

  • set: The name of the Redis set.
  • removed: The number of members successfully removed from the set.
  • members: An array of the members that were requested to be removed.

Example output JSON:

{
  "set": "mySet",
  "removed": 2,
  "members": ["member1", "member2"]
}

This output indicates how many members were removed and which members were targeted.

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API key or authentication token for connecting to Redis (configured as a credential in n8n).
  • Uses the Redis client library internally to communicate with the Redis instance.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Attempting to remove members from a non-existent set results in zero removals but no error.
    • Providing an empty or malformed members string may cause unexpected behavior or errors.
  • Error messages:

    • Errors related to Redis connection or command execution will be thrown and can be caught if "Continue On Fail" is enabled.
    • If the members list has invalid formatting, the node might throw an error indicating improper input.
  • Resolution tips:

    • Verify Redis credentials and network connectivity.
    • Ensure the "Members" property is correctly formatted as space-separated values.
    • Use "Continue On Fail" option to handle errors gracefully in workflows.

Links and References

Discussion