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

The **Fail** building block is used to end an automation case run in the **failed** state. It is typically used when your flow detects a condition that should stop execution and mark the case as failed.

See the [Introduction](https://www.leapwork.com/services/learning-center/introduction-virtual-automation-1) lesson to see an example of how to use it.

Fully expanded, the **Fail** block shows the following properties:  
![image-20260205-121631.png](https://docs.leapwork.com/__attachments/a_f124e48062597a4079dceb3393a95a788a9893d93784ec99f19f275141d7e33f/image-20260205-121631.png?cb=773021b0d77a95c480df461b270ef9e9)

**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 **Fail** onto the canvas.

2. Connect the block in the flow and optionally specify **Fail message** and **Text fields** (for tokenized values).

3. Run the flow when it's ready.

## Building block parameters

Parameters  
* **Block header** : Shows the current title of the block (default: "Fail"). You can rename it by double-clicking the title and typing a new one. The green input connector in the header is used to **trigger** the block to stop the running case and set it to the **failed** state.

* **Fail message** : Defines a message to be logged when the case is failed. The message can include tokens for field values you add under **Text fields** . To insert tokens, right-click in the message field and select **Insert token** .

* **Text fields** : Stores key--value fields that enable the use of external values in the **Fail message** . To use a field value in the message, right-click the message field, select **Insert token** , and insert the field's name.

* **Add field** : Adds a field that can be used as a token in the **Fail message**.

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