> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# observed_states

# `prefect.server.models.observed_states`

Discover states from retained flow and task run transitions.

## Functions

### `read_observed_states` <sup>[https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/models/observed\_states.py#L11](https://github.com/PrefectHQ/prefect/blob/main/src/prefect/server/models/observed_states.py#L11)</sup>

```python theme={null}
read_observed_states(db: PrefectDBInterface, session: AsyncSession, query: str | None = None, order_by: ObservedStateSort = ObservedStateSort.LAST_SEEN_DESC, limit: int = 200) -> list[ObservedState]
```

Combine exact state pairs and timestamp bounds from retained run histories.
