# Flows: Build Reusable Test Steps

:::lead
A Flow is a reusable sequence of steps that can be shared across multiple Test Cases and other Flows. Build it once, maintain it in one place, and every test that references it automatically uses the latest version.
:::

:::callout{title="When should I create a Flow?"}
Create a Flow whenever you have a sequence of steps you'll reuse across multiple tests. Common examples include logging in, navigating to a specific page, creating test data, or cleaning up data after a test.
:::

## The Flows page

Open **Flow** from the sidebar to see every Flow in the project. Summary cards show **Total Flows** and **Used Flows** (Flows that at least one test or Flow references). The table lists each Flow's **name**, **Used In** count, **Created By**, number of **Steps**, and **Tags**, and you can search, filter by tag, and delete Flows in bulk.

## Creating a Flow

You can create a Flow in any of the following ways:

1. **Record a new Flow** using the [Recorder](/docs/building-tests/recording-a-test) and choose to save it as a Flow.
2. **Create a Flow from selected steps** by selecting multiple steps in a Test Case and choosing **Create Flow**.
3. **Build one manually** in the [Step Editor](/docs/building-tests/the-editor) by dragging steps from the Step Palette.

## Using a Flow

Drag a Flow from the Flows list in the Step Palette into a Test Case or another Flow. You can also pick a Flow on the Home page to play it **before** a recording starts — handy for signing in first.

The Flow appears as a single collapsible step in the Step Tree. You can expand it to inspect the steps it contains, but any changes must be made by editing the original Flow.

:::info{title="Flows are live references"}
A Flow is never copied into a Test Case.

Instead, TestOwl stores a live reference to the original Flow. Whenever you update that Flow, every Test Case and Flow that references it automatically uses the latest version.

This lets you update shared workflows in one place instead of maintaining duplicate copies across multiple tests.
:::

![Flow live reference diagram](/images/building-tests/flows/flow-live-reference-diagram.png)

*One Flow, referenced by multiple tests. Update the Flow once, and every test automatically uses the latest version.*

## Flows can reference other Flows

Flows aren't limited to Test Cases—they can also be reused inside other Flows.

This allows you to build larger workflows from smaller reusable building blocks. For example, a **Checkout** Flow might reference separate **Login**, **Add Item to Cart**, and **Apply Coupon** Flows.

To keep your project maintainable, TestOwl automatically prevents circular references. A Flow can't directly or indirectly reference itself.

## Where a Flow is used

Every Flow displays a **Used In** count, showing how many Test Cases and Flows currently reference it. Click the count to see exactly where the Flow is used.

Before making significant changes, it's good practice to review where the Flow is used, especially if multiple tests depend on it.

## Deleting a Flow

A Flow that **isn't used anywhere** goes to the [Recycle Bin](/docs/workspace/recycle-bin) when you delete it, and can be restored within 15 days.

If a Flow **is still used elsewhere**, TestOwl won't send it to the Recycle Bin, because restoring it later would leave broken references. Instead it lists where the Flow is used and lets you choose to **delete it permanently**. That removes the Flow *and* its steps from every Test Case and Flow that used it, and can't be undone.

:::warning{title="Deleting a shared Flow affects multiple tests"}
Because Flows are shared across your project, deleting one may impact multiple Test Cases. Always review the **Used In** count before permanently removing a Flow.
:::

## Organising Flows

As your project grows, your Flow library will grow with it.

To keep it easy to navigate:

- Give Flows clear, action-based names such as **Log in as Admin**, **Add Item to Cart**, or **Complete Checkout**.
- Use [Tags](/docs/data/tags) to group related Flows.
- Keep each Flow focused on a single reusable task rather than one long end-to-end workflow.

Small, focused Flows are easier to understand, maintain, and reuse across different tests.

## Best practices

- Keep each Flow focused on a single responsibility.
- Reuse Flows instead of duplicating the same steps across multiple tests.
- Use descriptive names that clearly explain what the Flow does.
- Review the **Used In** count before making major changes to shared Flows.
- Build larger workflows by combining smaller Flows instead of creating one large Flow.

## Next steps

::::cardgrid
:::card{title="Test Cases" href="/docs/building-tests/test-cases"}
Learn how to build and organise runnable tests using Flows.
:::

:::card{title="Step Editor" href="/docs/building-tests/the-editor"}
Learn how to build and edit Flows using the visual editor.
:::

:::card{title="Tags" href="/docs/data/tags"}
Organise your Flow library with tags.
:::
::::