---
title: "set · RUAL Documentation"
description: "Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type."
canonical: https://docs.rual.nl/block-types/redis/function_redis_cache_set_key
language: en
---

# set

This block is part of the [`redis`](https://docs.rual.nl/block-types/redis) group and was last modified in core [`v13.0.6`](https://docs.rual.nl/core-versions/130006).

### Redis Key Selection Required

This block relies on a Redis key to perform its redis releated actions. You must manually select the Redis key you want to use in the flow in the blueprint using the Redis key selector modal. To access the modal, click the white button on the block.

Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.

- flow `flow`

- value required `value` Value being set, only accepts `value` types.

- TTL `number` Set the specified expire time, in seconds.

Default `none`

- flow `flow`

- success `v13.0.6` `condition`

- key `v13.0.6` `value` current redis key, this outpin be handy when using dynamic redis keys

| `redis set` |
| --- |
| `set cache` |

A typical wiring for [set](https://docs.rual.nl/block-types/redis/function_redis_cache_set_key): [branch](https://docs.rual.nl/block-types/flow/branch) feeds the `flow` pin; [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations) feeds the `key` pin; [stringify](https://docs.rual.nl/block-types/value/value_json_stringify_v2) feeds the `value` pin; the `flow` out pin feeds [return](https://docs.rual.nl/block-types/function%20execution/function_return); the `key` out pin feeds [reply in JSON](https://docs.rual.nl/block-types/json/httpconnection_set_json).

![Studio canvas example for the set block: typical wiring for set.](https://docs.rual.nl/canvas-examples/function_redis_cache_set_key.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [branch](https://docs.rual.nl/block-types/flow/branch): feeds into this block.

- [create](https://docs.rual.nl/block-types/globals/trigger_custom_function): feeds into this block. Creates a new function that can be executed using the given name.

- [create document](https://docs.rual.nl/block-types/storage/function_create_document_from_mutations): feeds into this block. Creates a document in the given storage.

- [return](https://docs.rual.nl/block-types/function%20execution/function_return): this block feeds into it. Returns the added custom pins as data-pins on the function execute.

- [reply in JSON](https://docs.rual.nl/block-types/json/httpconnection_set_json): this block feeds into it. Reply to any httpconnection as JSON body.

- [stringify](https://docs.rual.nl/block-types/value/value_json_stringify_v2): feeds into this block. uses JSON.stringify to produce a string of the given data.

### Used in these guides

These documentation pages use or explain this block:

- [Common Blueprint Patterns](https://docs.rual.nl/blueprints/common-patterns)

### Version history

Introduced in [`v11.0.0`](https://docs.rual.nl/core-versions/110000).

Last modified in [`v13.0.6`](https://docs.rual.nl/core-versions/130006).

### Service documentation
