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](/content/services/learning-center/introduction-virtual-automation-1/index.html) lesson to see an example of how to use it.

Fully expanded, the **Fail** block shows the following properties:

**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) | Common questions about creating, running, and managing flows in Leapwork. |
| [Flows Troubleshooting](https://docs.leapwork.com/troubleshooting/latest/leapwork-flow-troubleshooting/flows-troubleshooting) | Guidelines and solutions for identifying and fixing issues that occur when building or running flows in Leapwork.
