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 "Redis Enhanced" node provides a comprehensive interface to interact with a Redis database, supporting a wide range of operations such as setting, getting, deleting keys, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. It is designed for users who want to integrate Redis data storage and retrieval into their n8n workflows with enhanced capabilities beyond basic commands.
Common scenarios include:
- Caching data or session information.
- Managing queues using Redis lists.
- Publishing messages to Redis channels for real-time notifications.
- Performing atomic increments or conditional key updates.
- Executing Lua scripts for complex Redis operations.
For example, you can use this node to persist a key so it no longer expires, retrieve the value of a hash field, or push data onto a Redis list for queue processing.
Properties
| Name | Meaning |
|---|---|
| Operation | The Redis operation to perform. Options include: Append, Blocking Pop Left/Right, Delete, 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. |
| Key | The name of the Redis key to operate on (required for many operations). |
| Value | The value to set or append to a key (used in set, append, getset operations). |
| Key Type | The type of the key's data structure: Automatic, Hash, List, Sets, String. |
| Value Is JSON | For hash-type keys, whether the value is JSON or key-value pairs (boolean). |
| Expire | Whether to set an expiration timeout on the key (boolean). |
| TTL | Time-to-live in seconds before the key expires (number). |
| Set Mode | Controls when the key should be set: Always, Only if Not Exists (NX), Only if Exists (XX). |
| Property Name | The property name in the output JSON where retrieved data will be stored; supports dot notation. |
| Channel | The Redis channel name for publish operation. |
| Message Data | The message content to publish or push to a list. |
| List | The name of the Redis list for list operations like push, pop, blocking pop, length, range. |
| Tail | For push/pop operations, whether to operate at the end (tail) of the list (boolean). |
| Timeout | Timeout in seconds for blocking pop operations (0 means wait indefinitely). |
| Keys | Space-separated list of keys for multi-key operations like exists, mget, eval keys. |
| Key Pattern | Pattern to match keys for keys or scan operations. |
| Count | Approximate number of keys to return during scan operation. |
| Script | Lua script to execute in eval operation. |
| Arguments | Arguments to pass to the Lua script (space-separated). |
| Hash | Name of the hash key for hash-related operations. |
| Field | Field name within a hash for hexists operation. |
| Members | Space-separated members for set or sorted set operations. |
| Member | Single member to check membership in a set. |
| Sorted Set | Name of the sorted set for sorted set operations. |
| Score-Member Pairs | Space-separated score and member pairs for zadd operation. |
| Start, Stop | Indices defining ranges for list or sorted set range operations. |
| With Scores | Whether to include scores in sorted set range results (boolean). |
| Cursor | Cursor position for incremental scan operation. |
Output
The node outputs an array of JSON objects corresponding to each input item processed. The structure of the json output depends on the operation performed:
- For retrieval operations (
get,mget,keys,scan, etc.), the output contains the requested values keyed by their Redis keys or under specified property names. - For mutation operations (
set,delete,incr,persist, etc.), the output includes confirmation details such as new values, counts of affected items, or status flags. - For list and set operations, outputs include lengths, added/removed counts, or elements retrieved.
- For Lua script execution (
eval), the output contains the result of the script. - When dot notation is enabled for property names, nested JSON structures are created accordingly.
- If binary data were supported, it would be summarized here, but this node deals primarily with string and structured data.
Example output snippet for a persist operation:
{
"json": {
"key": "myKey",
"persisted": 1
}
}
Dependencies
- Requires a Redis server accessible via credentials configured in n8n.
- Needs an API key or authentication token for Redis connection (configured as credentials in n8n).
- Uses the Redis client library and lodash for internal operations.
- No additional external services are required beyond Redis itself.
Troubleshooting
- Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
- Invalid key or field names: Provide valid strings for keys, fields, and other identifiers.
- Mismatched key-value pairs in multi-set: The
msetoperation requires an even number of arguments representing key-value pairs. - Timeouts in blocking pop: A zero timeout waits indefinitely; non-zero timeouts may cause the operation to return null if no element is available.
- JSON parsing errors: When retrieving data expected to be JSON, invalid JSON strings may cause parsing failures; ensure stored data is valid JSON if
valueIsJSONis true. - Dot notation issues: If property names contain dots but dot notation is disabled, data will be stored as flat keys rather than nested objects.
- Lua script errors: Syntax or runtime errors in provided Lua scripts will throw errors; validate scripts independently before use.
If the node throws errors, enabling "Continue On Fail" allows workflow continuation with error details included in output.