> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/reference/actions/backend-flow.md).

# backend-flow Action

Used in [FLAT tests](/flat/reference/testing.md) to *register* a flow that mocks an upstream response.

## Syntax

```markup
<backend-flow request="id">
  <!-- flow actions -->
</backend-flow>
```

When [upstream requests](/flat/reference/actions/request.md) are carried out, their *request IDs* are matched against the `request=` attribute of the backend flow. On match, the backend flow is executed instead of the actual HTTP request.

If at least one backend flow is registered, no HTTP request will be sent. If no backend flow matches, the request will fail.

## See also

* [Testing API Requests](/flat/cookbook/test-api-request.md) (cookbook)
* [Testing Upstream Requests](/flat/cookbook/test-backend.md) (cookbook)
* [Testing](/flat/reference/testing.md) (reference)
