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 operations such as appending data to strings, setting and getting keys, managing hashes, lists, sets, sorted sets, and executing Lua scripts. The "Append" operation specifically appends a given value to the end of an existing string stored at a specified key in Redis.

This node is beneficial in scenarios where you need to manipulate Redis data directly within an n8n workflow, for example:

  • Appending logs or incremental data to a Redis string key.
  • Building up messages or accumulating values over time without overwriting existing data.
  • Integrating Redis-based caching or state management into automation workflows.

Practical example: You have a Redis key storing a log string, and each time an event occurs, you append a new log entry to this string using the Append operation.

Properties

Name Meaning
Key The name of the Redis key to which the value will be appended.
Value The string value to append to the existing value of the specified key.
Value Is JSON (Shown only if key type is hash) Whether the value should be treated as JSON or key-value pairs.

Note: For the Append operation, only "Key" and "Value" are required and used.

Output

The output JSON object for the Append operation contains:

  • key: The Redis key to which the value was appended.
  • newLength: The new length of the string after the append operation.

Example output:

{
  "key": "myKey",
  "newLength": 42
}

This indicates that the value was successfully appended and the resulting string length is 42 characters.

The node does not output binary data for this operation.

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 perform commands.
  • No additional external services are required beyond Redis itself.

Troubleshooting

  • Common issues:

    • Connection failures due to incorrect Redis credentials or network issues.
    • Attempting to append to a key holding non-string data types may cause errors.
    • Providing invalid or empty keys or values will result in errors.
  • Error messages:

    • "Invalid JSON in value": Occurs if JSON parsing is attempted on malformed input (relevant for hash operations).
    • Redis command errors: May occur if the key type is incompatible with the append operation.
  • Resolutions:

    • Verify Redis credentials and connectivity.
    • Ensure the key exists and holds a string or is empty before appending.
    • Provide valid string values for appending.
    • Use the "continue on fail" option to handle errors gracefully in workflows.

Links and References

Discussion