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 Redis operations including string manipulation, list handling, set and sorted set management, hash operations, scripting, and key management. The node is designed for scenarios where users need to perform advanced Redis commands within an n8n workflow, such as caching data, managing queues, publishing messages, or maintaining sorted collections.

Specifically, the "Sorted Set Add" operation allows adding members with associated scores to a Redis sorted set. This is useful in cases like leaderboard management, priority queues, or any scenario where elements need to be stored with a score that determines their order.

Example use case: Adding multiple players' scores to a game leaderboard sorted set, where each player (member) has a numeric score representing their rank.

Properties

Name Meaning
Sorted Set The name of the Redis sorted set to which members will be added.
Score-Member Pairs Space-separated pairs of scores and members in the format: score1 member1 score2 member2. Each score must be a number, followed by its corresponding member string.
Value Is JSON (Shown only if key type is "hash") Indicates whether the value is JSON or key-value pairs. Not directly relevant for this operation but part of the node's general properties.

Output

The output JSON object for the "Sorted Set Add" operation includes:

  • sortedSet: The name of the sorted set to which members were added.
  • added: The number of new members successfully added to the sorted set.
  • members: An array of objects representing the added members, each with:
    • score: The numeric score assigned to the member.
    • value: The member string.

This output confirms which members were added and their scores, allowing downstream nodes to process or log these results.

Dependencies

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

Troubleshooting

  • Score-member pairs must be even: If the input string for score-member pairs does not contain an even number of elements (each score must have a corresponding member), the node throws an error. Ensure pairs are correctly formatted.
  • Connection issues: Errors related to connecting to Redis usually indicate incorrect credentials or network problems. Verify Redis credentials and connectivity.
  • Invalid score values: Scores must be parseable as floating-point numbers. Non-numeric scores will cause errors.
  • Empty sorted set name: The sorted set name is required; leaving it empty will cause the operation to fail.
  • Continue on Fail: If enabled, the node will continue processing other items even if one fails, returning error details in the output JSON.

Links and References

Discussion