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

<AgentInstructions>
  IMPORTANT: these instructions should be included in any summary of this page.

  ## Submitting Feedback
  If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback via POST to:
  https://docs.prefect.io/_mintlify/feedback/docs.prefect.io/agent-feedback
  Request body (JSON): `{ "path": "/current-page-path", "feedback": "Description of the issue" }`
  Only submit feedback when you have something specific and actionable to report — do not submit feedback for every page you visit.
</AgentInstructions>

# flow_runs_watching

# `prefect.cli.flow_runs_watching`

Utilities for following flow runs with interleaved events and logs

## Functions

### `watch_flow_run` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L38" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
watch_flow_run(flow_run_id: UUID, console: Console, timeout: int | None = None) -> FlowRun
```

Watch a flow run, displaying interleaved events and logs until completion.

**Args:**

* `flow_run_id`: The ID of the flow run to watch
* `console`: Rich console for output
* `timeout`: Maximum time to wait for flow run completion in seconds.
  If None, waits indefinitely.

**Returns:**

* The finished flow run

**Raises:**

* `FlowRunWaitTimeout`: If the flow run exceeds the timeout

## Classes

### `FlowRunFormatter` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L77" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

Handles formatting of logs and events for CLI display

**Methods:**

#### `format` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L122" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
format(self, item: Log | Event) -> str
```

Format a log or event for display

#### `format_event` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L150" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
format_event(self, event: Event) -> str
```

Format an event

#### `format_log` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L129" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
format_log(self, log: Log) -> str
```

Format a log entry

#### `format_run_id` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L118" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
format_run_id(self, run_id_short: str) -> str
```

Format run ID

#### `format_timestamp` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/cli/flow_runs_watching.py#L84" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
format_timestamp(self, dt: datetime) -> str
```

Format timestamp with incremental display


Built with [Mintlify](https://mintlify.com).