---
title: "increment · RUAL Documentation"
description: "Increments the number stored at key by one. If the key does not exist, it is set to 0 before performing the operation."
canonical: https://docs.rual.nl/block-types/redis/function_redis_cache_incr_key
language: en
---

# increment

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.

Increments the number stored at key by one. If the key does not exist, it is set to `0` before performing the operation.

- flow `flow`

- number required `number` Number to increment given cache key with.

- flow `flow`

- number `number` New number.

- error `value`

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

| `redis incr` |
| --- |
| `incr` |

A typical wiring for [increment](https://docs.rual.nl/block-types/redis/function_redis_cache_incr_key): [number](https://docs.rual.nl/block-types/number/number_default) feeds the `number` pin; [remote ip](https://docs.rual.nl/block-types/http%20connection/httpconnection_get_ip) feeds the `key` pin; the `output` out pin feeds [<=](https://docs.rual.nl/block-types/condition/condition_lte); the `flow` out pin feeds [set cache ttl](https://docs.rual.nl/block-types/redis/function_redis_cache_ttl).

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

### Commonly used with

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

- [set cache ttl](https://docs.rual.nl/block-types/redis/function_redis_cache_ttl): wired in both directions with this block. set the time to live in seconds.

- [number](https://docs.rual.nl/block-types/number/number_default): feeds into this block. Generates a valid number from the filled custom value in the blueprint.

- [<=](https://docs.rual.nl/block-types/condition/condition_lte): this block feeds into it. returns true if the number is lower or equal.

- [remote ip](https://docs.rual.nl/block-types/http%20connection/httpconnection_get_ip): feeds into this block. Returns the currently connected user IP.

- [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.

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

### 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).
