Redis
Description
Section titled “Description”The Redis node connects to a Redis server and runs an operation on a key: read or write values, delete them, increment or decrement them, check their existence, list keys by pattern, or publish to a channel. It is useful for caching results, keeping counters, coordinating processes, or sending messages between workflows.
It is equivalent to n8n’s Redis node.
The node opens the connection at the start, runs the operation, and closes the connection when finished. All connection fields and the key/value support dynamic variables.
Configuration
Section titled “Configuration”Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| host | text | Yes | Redis server host. Example: 127.0.0.1 |
| port | number | No | Server port. Defaults to 6379 |
| password | text | No | Server password (if applicable) |
| db | number | No | Redis database number. Defaults to 0 |
| operation | select | Yes | Operation: get, set, delete, incr, decr, exists, keys, publish |
| key | text | Yes | Key (get/set/delete/incr/decr/exists), pattern (keys) or channel (publish) |
| value | textarea | No | Value to write or message to publish (only set / publish) |
| ttl | number | No | TTL in seconds for the key (only set). If greater than 0, the key expires |
| outputKey | text | No | Field name where the result is stored. Defaults to redis |
Output
Section titled “Output”The node adds the operation result to data in the field named by outputKey (default redis). The value depends on the operation:
{ "user_id": 42, "redis": "OK"}Values returned per operation:
| Operation | Result |
|---|---|
get | The key value (or null if it does not exist) |
set | "OK" |
delete | Number of keys deleted |
incr / decr | New numeric value of the key |
exists | 1 if it exists, 0 if not |
keys | Array of keys matching the pattern |
publish | Number of subscribers that received the message |
Usage Examples
Section titled “Usage Examples”Store a value with expiration (cache)
Section titled “Store a value with expiration (cache)”{ "label": "Cache token", "host": "127.0.0.1", "operation": "set", "key": "token:{{data.user_id}}", "value": "{{data.access_token}}", "ttl": "3600", "outputKey": "cache_result"}Stores the token with a 1-hour expiration.
Read a cached value
Section titled “Read a cached value”{ "label": "Read token", "host": "127.0.0.1", "operation": "get", "key": "token:{{data.user_id}}", "outputKey": "token"}Increment a counter
Section titled “Increment a counter”{ "label": "Count visits", "host": "127.0.0.1", "operation": "incr", "key": "visits:home", "outputKey": "total_visits"}Publish to a channel
Section titled “Publish to a channel”{ "label": "Notify", "host": "127.0.0.1", "operation": "publish", "key": "notifications", "value": "{{data.message}}"}- If the operation is not one of the supported ones, the node returns a descriptive error
- For
keys, if no pattern is given,*(all keys) is used; use with care on large databases - If the input
datais an object, the result is added without losing existing fields; if not, it is wrapped in{ value, [outputKey] } - The connection uses
lazyConnect, an 8-second connect timeout, and up to 2 retries per request - The connection fields,
key, andvaluesupport dynamic variables:{{data.field}},{{@NodeName.field}} - Does not require catalog credentials: the connection details are provided in the node itself