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
This node provides enhanced interaction with a Redis database, allowing users to perform a wide range of operations such as deleting keys, setting values, incrementing counters, publishing messages, manipulating lists, sets, sorted sets, hashes, and executing Lua scripts. The "Delete" operation specifically enables the removal of one or multiple keys from Redis in a single action.
Common scenarios where this node is beneficial include:
- Cleaning up obsolete or temporary data stored in Redis by deleting specific keys.
- Managing cache invalidation by removing outdated cache entries.
- Automating maintenance tasks that require bulk deletion of keys.
- Integrating Redis key management into larger workflows for data synchronization or cleanup.
Practical example:
- A workflow that deletes session keys after user logout by specifying all related keys separated by spaces.
- Removing multiple feature flags or configuration keys at once during deployment processes.
Properties
| Name | Meaning |
|---|---|
| Key(s) | Name(s) of the Redis key(s) to delete. For multiple keys, separate them with spaces (e.g., "key1 key2 key3"). This property is required for the Delete operation. |
(Note: The "Value Is JSON" property is not relevant for the Delete operation and thus omitted here.)
Output
The output is an array of JSON objects, each corresponding to an input item processed. For the Delete operation, each output JSON object contains:
deletedKeys: An array of the key names that were requested to be deleted.deletedCount: The number of keys that were actually deleted by Redis.
Example output JSON:
{
"deletedKeys": ["key1", "key2", "key3"],
"deletedCount": 3
}
This output allows downstream nodes to confirm which keys were deleted and how many deletions occurred.
Dependencies
- Requires a connection to a Redis instance.
- Needs an API authentication credential configured in n8n to connect securely to Redis.
- The node uses the Redis client library internally to communicate with the Redis server.
Troubleshooting
Common issues:
- Providing empty or invalid key names will cause errors or no keys to be deleted.
- Network or authentication failures when connecting to Redis will prevent execution.
- Attempting to delete keys that do not exist will result in a deleted count of zero but is not an error.
Error messages:
- Errors related to connection failure: Check Redis credentials and network connectivity.
- Invalid key format errors: Ensure keys are correctly specified and separated by spaces.
- If the node is set to continue on fail, errors will be returned in the output JSON under an
errorfield for the respective item.
Links and References
- Redis DEL command documentation
- Redis official website
- n8n Documentation (for general usage of custom nodes and credentials)