RedisExtended icon

RedisExtended

Get, send and update data in Redis

Overview

The node provides extended Redis operations to interact with a Redis database. It supports various commands such as retrieving keys matching a pattern, getting and setting values, deleting keys or hash fields, incrementing counters, publishing messages to channels, and manipulating lists and hashes.

The Keys operation specifically returns all keys that match a given pattern. Optionally, it can also retrieve the values of those keys. This is useful for scenarios where you want to discover keys dynamically based on patterns (e.g., all keys starting with "user:"), and optionally fetch their associated data in bulk.

Practical examples:

  • Fetch all session keys matching session:* and get their current values.
  • List all cache keys matching cache:* without fetching values to monitor cache usage.
  • Retrieve keys related to a specific feature or module by pattern matching.

Properties

Name Meaning
Key Pattern The pattern used to match keys in Redis. Supports wildcards like *.
Get Values 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 is JSON or key-value pairs.

Output

The output is an array of JSON objects, each representing one input item processed.

  • If Get Values is false, the output JSON contains a single property keys which is an array of matching key names.
  • If Get Values is true, the output JSON contains properties named after each matched key, with their corresponding values fetched from Redis.

Example when getValues is false:

{
  "keys": ["user:1", "user:2", "user:3"]
}

Example when getValues is true:

{
  "user:1": "value1",
  "user:2": "value2",
  "user:3": "value3"
}

If the node encounters errors and is configured to continue on failure, the output will contain an error property describing the issue.

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 internally to connect and execute commands.

Troubleshooting

  • Connection errors: Ensure Redis credentials are correct and the Redis server is reachable.
  • Empty results: Verify the key pattern matches existing keys; Redis patterns are case-sensitive.
  • Permission issues: Make sure the Redis user has permissions to run KEYS and GET commands.
  • Large result sets: Using KEYS on large databases can be slow and block Redis. Consider using SCAN in production environments.
  • JSON parsing errors: If values are expected to be JSON but are malformed, parsing may fail. Validate stored data format.

Common error messages:

  • "ECONNREFUSED": Connection refused by Redis server — check host/port and server status.
  • "NOAUTH Authentication required": Missing or invalid authentication — verify credentials.
  • "ERR unknown command '...' ": Redis version might not support the command — check Redis version compatibility.

Links and References

Discussion