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
This node, "Redis Enhanced," provides a comprehensive interface to interact with a Redis database. It supports a wide range of Redis operations such as retrieving keys by pattern, getting and setting values, incrementing counters, managing lists, sets, sorted sets, hashes, publishing messages, running Lua scripts, and more.
The Keys operation specifically returns all keys matching a given pattern, optionally fetching their associated values. This is useful for scenarios where you want to discover or audit keys in your Redis instance that match certain criteria, for example:
- Retrieving all user session keys starting with
session:*. - Fetching all cache keys related to a specific feature.
- Debugging or monitoring keys by pattern.
Practical example: You want to get all keys starting with order: and also retrieve their values to analyze recent orders stored in Redis.
Properties
| Name | Meaning |
|---|---|
| Key Pattern | The pattern used to match keys in Redis (e.g., user:* to match all keys starting with "user:"). |
| Get Values | Boolean flag indicating whether to fetch the values of the matched keys (true) or just return the key names (false). |
| Value Is JSON | (Shown only if key type is hash) Indicates whether the value should be interpreted as JSON or as key-value pairs. |
Output
The output is an array of JSON objects, each representing the result of processing one input item.
For the Keys operation:
If Get Values is
false, the output JSON contains:{ "keys": ["key1", "key2", ...] }A simple list of keys matching the pattern.
If Get Values is
true, the output JSON contains key-value pairs where each key is a matched Redis key and the value is the corresponding Redis value fetched from the database:{ "key1": <value_of_key1>, "key2": <value_of_key2>, ... }The values are retrieved according to their Redis data types and may be strings, lists, hashes, etc., depending on the key.
No binary data output is indicated for this operation.
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key credential or connection details for Redis authentication.
- Uses the Redis client library internally to connect and execute commands.
- No additional external services are required beyond Redis itself.
Troubleshooting
Common issues:
- Connection failures due to incorrect Redis credentials or network issues.
- Pattern syntax errors leading to no keys being matched.
- Large numbers of keys returned causing performance delays or timeouts.
- Errors when fetching values if keys have unexpected data types or corrupted data.
Error messages:
- Connection errors will typically indicate inability to connect or authenticate with Redis.
- If the key-value pairs are malformed or the number of arguments is incorrect (not applicable directly here but relevant for other operations), errors will be thrown.
- If the node is set to continue on failure, errors for individual items will be included in the output JSON under an
errorproperty.
Resolutions:
- Verify Redis credentials and network connectivity.
- Use appropriate key patterns to limit results.
- Enable "continue on fail" to handle partial failures gracefully.
- Check Redis server logs for deeper diagnostics.