---
version: "2026.1.0"
language: "en"
---
# Lock

The **Lock** block locks the desktop session for the user account running on the Agent machine. It is typically used to simulate real-world security scenarios, or to reset session state between test cases.

Once triggered, the block attempts to perform a system lock within a given timeout period.

Fully expanded, the Lock building block shows the following properties:  
![image-20251117-150937.png](https://docs.leapwork.com/__attachments/a_20da571ef321aa82bd9a9f6e97cea283d591df8f7d352c512050abe069dcf217/image-20251117-150937.png?cb=dad1726ba562dff6b58ab7475bf8e7fa)

**Note:** The screenshot on this page uses the **Elegance Design** , introduced in **2025.3**. If you are using an earlier version, your layout may look different.

## Quick-start

1. Drag **Lock** onto the canvas.

2. Connect the block in the flow and optionally specify **Timeout (sec)**.

3. Run the flow when it's ready.

## Building block parameters

Parameters  
* **Block header** : The block title ("Lock") can be renamed by double-clicking it and typing in a new title.

* **Failed** : Triggers if locking the system is not completed within the configured timeout.

* **Timeout (sec)** : The maximum time the block will spend performing the lock operation before triggering **Failed**.

## Resources

|                                                **Topic**                                                |                                                  **Description**                                                  |
|---------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| [Flows FAQ](https://docs.leapwork.com/faq/latest/leapwork-flow-faq/flows-faq.md)                                                 | Common questions about creating, running, and managing flows in Leapwork.                                         |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting.md) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork. |