---
title: "claim lock · RUAL Documentation"
description: "Tries to claim a lock and returns if it was successful or not"
canonical: https://docs.rual.nl/block-types/locking/function_claim_lock_v2
language: en
---

# claim lock

This block is part of the [`locking`](https://docs.rual.nl/block-types/locking) group and was last modified in core [`v15.0.0`](https://docs.rual.nl/core-versions/150000).

Tries to claim a lock and returns if it was successful or not

- flow `flow`

- key required `value`

- expiry (sec.) `number` Expiry in seconds to claim this lock.

Default `60`

- auto clear `v15.0.0` `condition` Release this lock automatically when the flow ends : no separate free lock block needed.

- flow `flow`

- success `condition`

- error `value`

A typical wiring for [claim lock](https://docs.rual.nl/block-types/locking/function_claim_lock_v2): [branch](https://docs.rual.nl/block-types/flow/branch) feeds the `flow` pin; [concatenate values](https://docs.rual.nl/block-types/value/value_concatenate) feeds the `key` pin; [number](https://docs.rual.nl/block-types/number/number_default) feeds the `expiry` pin; the `flow` out pin feeds [branch](https://docs.rual.nl/block-types/flow/branch).

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

### Commonly used with

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

- [branch](https://docs.rual.nl/block-types/flow/branch): wired in both directions with this block.

- [concatenate values](https://docs.rual.nl/block-types/value/value_concatenate): feeds into this block.

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

- [one hour](https://docs.rual.nl/block-types/number/number_one_hour): feeds into this block. Returns one hour in seconds as a number.

### Used in these guides

These documentation pages use or explain this block:

- [Block Execution](https://docs.rual.nl/blueprints/block-execution)

- [Locking and Concurrency](https://docs.rual.nl/blueprints/locking)

### Version history

Introduced in [`v12.0.4`](https://docs.rual.nl/core-versions/120004).

Last modified in [`v15.0.0`](https://docs.rual.nl/core-versions/150000).
