Actions35
- 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
- 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 such as getting, setting, deleting keys, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. It is designed for users who want to perform advanced Redis operations within n8n workflows without writing custom code.
For the String Length operation specifically, the node retrieves the length of the string stored at a given key in Redis. This is useful when you need to check the size of string data stored in Redis, for example, to validate input sizes, monitor data growth, or conditionally trigger actions based on string length.
Practical examples:
- Checking the length of a cached JSON string before processing it.
- Monitoring the size of a session token stored as a string.
- Validating that a string value meets minimum or maximum length requirements before further workflow steps.
Properties
| Name | Meaning |
|---|---|
| Key | The name of the Redis key whose string length you want to retrieve. |
Note: The provided properties JSON includes "Value Is JSON" and "Key" but for the String Length operation only the "Key" property is relevant and required.
Output
The output JSON object contains:
key: The Redis key queried.length: The length of the string stored at the specified key.
Example output JSON:
{
"key": "myStringKey",
"length": 42
}
This output indicates the number of characters in the string value stored at the given key.
The node does not output binary data for this operation.
Dependencies
- Requires a connection to a Redis instance.
- Needs an API key credential or equivalent authentication configured in n8n to connect to Redis.
- Uses the Redis client library internally to communicate with the Redis server.
Troubleshooting
Common issues:
- Key does not exist or is not a string type: The length returned may be zero or an error might occur.
- Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
- Permission errors: The Redis user must have permission to read the key.
Error messages:
"Key does not exist"or similar: Verify the key name is correct and exists in Redis.- Connection timeout or refused: Check network connectivity and Redis server status.
"WRONGTYPE Operation against a key holding the wrong kind of value": The key exists but is not a string; ensure the key stores string data.
To resolve errors, verify the Redis key and its type, confirm credentials and connectivity, and consult Redis logs if needed.