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 including setting keys, retrieving values, managing lists, sets, sorted sets, hashes, and controlling key expiration. The "Expire At" operation specifically allows users to set a key to expire at a precise Unix timestamp.

This node is beneficial in scenarios where you need to manage cache lifetimes, session expirations, or any time-sensitive data stored in Redis. For example, you can use the "Expire At" operation to automatically invalidate a user's session key at a specific time or schedule temporary feature flags that expire exactly when needed.

Properties

Name Meaning
Key Name of the key to expire in Redis.
Timestamp Unix timestamp (seconds since epoch) at which the key should expire.
Value Is JSON Whether the value is JSON or key-value pairs (only relevant if key type is hash).

Output

The output is an array of JSON objects, each representing the result of the operation for each input item processed. For the "Expire At" operation, the output JSON contains:

  • key: The name of the key on which expiration was set.
  • set: A boolean indicating whether the expiration was successfully set (true) or not (false).

Example output JSON:

{
  "key": "myKey",
  "set": true
}

No binary data output is produced by this operation.

Dependencies

  • Requires a Redis server connection configured via credentials providing necessary authentication (e.g., API key or password).
  • The node uses a Redis client library internally to communicate with the Redis instance.
  • No additional environment variables are required beyond the Redis connection credentials.

Troubleshooting

  • Common issues:

    • Invalid or unreachable Redis server: Ensure the Redis server address and credentials are correct and accessible from n8n.
    • Incorrect timestamp format: The timestamp must be a valid Unix timestamp in seconds.
    • Key does not exist: Setting expiration on a non-existent key will return set: false.
  • Error messages:

    • Connection errors: Indicate problems connecting to Redis; verify network and credentials.
    • Invalid parameters: Errors thrown if required parameters like key or timestamp are missing or invalid.
  • Resolution tips:

    • Double-check all input parameters for correctness.
    • Test Redis connectivity separately to confirm access.
    • Use the node's "Continue On Fail" option to handle errors gracefully during batch processing.

Links and References

Discussion