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 executing Lua scripts. The "Expire At" operation specifically allows users to set an expiration timestamp on a given key, after which the key will be automatically deleted by Redis.

This node is beneficial in scenarios where you want to manage cache lifetimes, session expirations, or any time-sensitive data stored in Redis. For example, you can use the "Expire At" operation to ensure that temporary tokens or cached API responses are removed at a precise Unix timestamp, helping maintain data freshness and optimize memory usage.

Properties

Name Meaning
Key Name of the key to expire in Redis
Timestamp Unix timestamp (in seconds) when the key should expire

Output

The output JSON object for the "Expire At" operation contains:

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

Example output:

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

This confirms that the expiration timestamp was applied to the specified key.

Dependencies

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

Troubleshooting

  • Common issues:

    • Invalid or unreachable Redis server credentials will cause connection failures.
    • Setting expiration on a non-existent key will return set: false.
    • Providing an invalid timestamp (e.g., zero or past timestamps) may result in unexpected behavior or failure to set expiration.
  • Error messages:

    • Connection errors typically indicate misconfigured credentials or network issues.
    • Errors about key existence or command failures usually mean the key does not exist or Redis rejected the command.
  • Resolutions:

    • Verify Redis credentials and connectivity.
    • Ensure the key exists before setting expiration.
    • Use valid future Unix timestamps for expiration.

Links and References

Discussion