RedisExtended icon

RedisExtended

Get, send and update data in Redis

Overview

The node "RedisExtended" allows users to interact with a Redis database by performing various operations such as setting, getting, deleting keys, manipulating hashes, lists, sets, and publishing messages. The "Set" operation specifically enables writing data into Redis under a specified key with support for different Redis data types (string, hash, list, set) and optional expiration time.

This node is beneficial in scenarios where you want to store or update data in Redis from an n8n workflow, such as caching API responses, managing session data, or queuing tasks. For example, you can use the "Set" operation to save user session information as a hash or push items into a Redis list for processing.

Properties

Name Meaning
Key Name of the key to set in Redis.
Value The value to write in Redis.
Key Type The type of the key to set. Options:
- Automatic: Tries to figure out the type automatically depending on the data.
- Hash: Data in key is of type 'hash'.
- List: Data in key is of type 'list'.
- Sets: Data in key is of type 'sets'.
- String: Data in key is of type 'string'.
Value Is JSON (Only shown if Key Type is 'hash') Whether the value is JSON or key-value pairs.
Expire Whether to set a timeout (expiration) on the key.
TTL Number of seconds before key expiration (only applicable if Expire is true).

Output

The output of the "Set" operation returns the input data unchanged, meaning it passes through the original input items after setting the values in Redis. There is no additional JSON output generated by this operation itself.

If errors occur during execution and "Continue On Fail" is enabled, the output will contain an error message in the json.error field corresponding to the failed item.

Dependencies

  • Requires a Redis server connection configured via credentials that provide necessary authentication.
  • Uses a Redis client library to connect and execute commands.
  • The node expects the Redis server to be reachable and properly configured.

Troubleshooting

  • Connection issues: If the node cannot connect to Redis, verify the credentials and network connectivity to the Redis server.
  • Invalid key or value: Ensure the key names and values conform to Redis requirements and the selected key type.
  • JSON parsing errors: When using "Value Is JSON" for hash types, ensure the provided value is valid JSON; otherwise, the operation may fail.
  • Expiration settings: Setting TTL without enabling Expire will have no effect; make sure both are correctly configured.
  • Error messages: Errors thrown during Redis commands will appear in the node's error output if "Continue On Fail" is enabled. Otherwise, the workflow will stop with an error indicating the issue.

Links and References

Discussion