Skip to content

Redis

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.

ParameterTypeRequiredDescription
hosttextYesRedis server host. Example: 127.0.0.1
portnumberNoServer port. Defaults to 6379
passwordtextNoServer password (if applicable)
dbnumberNoRedis database number. Defaults to 0
operationselectYesOperation: get, set, delete, incr, decr, exists, keys, publish
keytextYesKey (get/set/delete/incr/decr/exists), pattern (keys) or channel (publish)
valuetextareaNoValue to write or message to publish (only set / publish)
ttlnumberNoTTL in seconds for the key (only set). If greater than 0, the key expires
outputKeytextNoField name where the result is stored. Defaults to redis

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:

OperationResult
getThe key value (or null if it does not exist)
set"OK"
deleteNumber of keys deleted
incr / decrNew numeric value of the key
exists1 if it exists, 0 if not
keysArray of keys matching the pattern
publishNumber of subscribers that received the message
{
"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.

{
"label": "Read token",
"host": "127.0.0.1",
"operation": "get",
"key": "token:{{data.user_id}}",
"outputKey": "token"
}
{
"label": "Count visits",
"host": "127.0.0.1",
"operation": "incr",
"key": "visits:home",
"outputKey": "total_visits"
}
{
"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 data is 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, and value support dynamic variables: {{data.field}}, {{@NodeName.field}}
  • Does not require catalog credentials: the connection details are provided in the node itself