Actions36
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Keys
- Hash Length
- Hash Values
- Increment
- Info
- Keys
- List Length
- List Range
- Multi Get
- Multi Set
- Persist
- Pop
- Publish
- Push
- Scan
- Set
- Set Add
- Set Cardinality
- Set Is Member
- Set Remove
- Sorted Set Add
- Sorted Set Cardinality
- Sorted Set Range
- Sorted Set Remove
- String Length
- TTL
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, meaning the key will automatically be deleted from Redis at the specified Unix timestamp.
This node is beneficial in scenarios where data lifecycle management is important, such as caching systems, session management, or temporary data storage that should expire after a certain time. For example, you can use the "Expire At" operation to ensure a cache entry expires exactly at midnight or to invalidate user sessions at a specific time.
Properties
| Name | Meaning |
|---|---|
| Key | The name of the Redis key to set an expiration timestamp on. |
| Timestamp | The Unix timestamp (seconds since epoch) when the key should expire. |
Output
The output JSON object for the "Expire At" operation contains:
key: The name of the key on 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 connect and execute commands.
Troubleshooting
Common issues:
- Invalid or unreachable Redis server connection: Ensure the Redis credentials are correct and the server is reachable.
- Setting expiration on a non-existent key: The operation will return
set: falseif the key does not exist. - Incorrect timestamp format: The timestamp must be a valid Unix timestamp in seconds.
Error messages:
- Connection errors: Check network connectivity and credential correctness.
- "Key-value pairs must be even number of arguments": Not relevant for this operation but may appear if other operations are misconfigured.
- If the node throws an error about invalid parameters, verify that the "Key" and "Timestamp" fields are correctly filled.