Redis Enhanced icon

Redis Enhanced

Get, send and update data in Redis with enhanced operations

Overview

This node, named "Redis Enhanced," provides advanced operations to interact with a Redis database. It supports a wide range of Redis commands such as getting and setting keys, manipulating lists, sets, sorted sets, hashes, executing Lua scripts, and more. The "Pop" operation specifically allows users to remove and retrieve an element from a Redis list either from the head (start) or tail (end).

Common scenarios where this node is beneficial include:

  • Managing queues or stacks stored in Redis lists by pushing and popping elements.
  • Retrieving data from Redis lists for processing workflows.
  • Integrating Redis-based caching or messaging systems within n8n automation.

For example, using the "Pop" operation, you can implement a worker that processes tasks from a Redis queue by popping items from the list's head or tail and then performing actions based on the popped data.

Properties

Name Meaning
List Name of the Redis list from which to pop data.
Tail Boolean flag indicating whether to pop from the end (tail) of the list (true) or from the start (false).
Name Optional property name to store the popped data in the output JSON. Supports dot-notation for nested assignment. Example: "data.person[0].name".
Options Collection of additional options:
- Dot Notation Boolean flag controlling if dot-notation is used when writing the popped data to the output property. If true (default), "a.b" will create nested objects { "a": { "b": value } }. If false, it will set the property as { "a.b": value }.

Output

The node outputs JSON data containing the popped element from the specified Redis list. The structure depends on the "Name" property and the dot-notation option:

  • The popped value is parsed as JSON if possible; otherwise, it is returned as a string.
  • The value is assigned to the output JSON under the key specified by the "Name" property.
  • If dot-notation is enabled, nested objects are created accordingly.
  • Additionally, the output includes the original input data merged with the Redis result.

No binary data output is produced by this operation.

Example output JSON snippet if propertyName is "poppedItem" and the popped value is a JSON object:

{
  "poppedItem": {
    "id": 123,
    "task": "process"
  }
}

Dependencies

  • Requires a Redis server accessible via credentials configured in n8n.
  • Needs an API key or authentication token credential for connecting to Redis.
  • Uses the Redis client library internally to perform operations.
  • No additional external services are required beyond Redis itself.

Troubleshooting

  • Empty List: If the list is empty, the pop operation returns null for the popped value. Ensure the list contains elements before popping.
  • Invalid JSON Parsing: If the popped value is not valid JSON, it is returned as a raw string. This may cause issues if downstream nodes expect structured data.
  • Connection Issues: Errors related to Redis connection failure may occur if credentials are incorrect or the Redis server is unreachable.
  • Dot Notation Misuse: If dot-notation is enabled but the property name does not match expected structure, the output JSON may be nested unexpectedly. Disable dot-notation if flat keys are preferred.
  • Error Handling: If an error occurs during execution, the node throws an error unless "Continue On Fail" is enabled, in which case the error message is included in the output JSON.

Links and References

Discussion