Actions41
- Append
- Blocking Pop Left
- Blocking Pop Right
- Delete
- Eval
- Exists
- Expire At
- Get
- Get Set
- Hash Exists
- Hash Get
- Hash Keys
- Hash Length
- Hash Set
- Hash Values
- Increment
- Info
- Keys
- List Length
- List Range
- Multi Get
- Multi Hash Get
- Multi Mix Get
- Multi Mix Set
- 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 data retrieval, modification, and management. The "Increment" operation atomically increases the value of a specified key by 1, creating the key if it does not exist. Optionally, it can set an expiration timeout on the key.
This node is beneficial in scenarios where atomic counters are needed, such as tracking page views, counting events, or managing rate limits. For example, incrementing a user's login attempt count or increasing the number of items sold in an e-commerce application.
Properties
| Name | Meaning |
|---|---|
| Key | Name of the key to increment |
| Expire | Whether to set a timeout (expiration) on the key after incrementing |
| TTL | Number of seconds before the key expires (only applicable if Expire is true) |
| Value Is JSON | (Not relevant for Increment operation; related to hash key types) |
Output
The output JSON contains the incremented value of the specified key. The key name is used as the property name, and its value is the new integer value after increment.
Example output:
{
"yourKeyName": 42
}
This indicates that the key "yourKeyName" was incremented to the value 42.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key or authentication token for connecting to the Redis instance.
- Uses the Redis client library internally to perform commands.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Attempting to increment a key that holds a non-integer value will cause an error.
- Setting expiration (
Expire= true) with invalid TTL values (less than 1) may cause unexpected behavior.
Error messages:
- Errors from Redis client (e.g., connection refused, command errors) will be surfaced.
- If JSON parsing fails (not applicable here but relevant for other operations), an error indicating invalid JSON will appear.
Resolutions:
- Verify Redis credentials and network connectivity.
- Ensure the key being incremented either does not exist or holds an integer value.
- Use valid TTL values when setting expiration.