> ## 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_run

# `prefect.runtime.flow_run`

Access attributes of the current flow run dynamically.

Note that if a flow run cannot be discovered, all attributes will return empty values.

You can mock the runtime attributes for testing purposes by setting environment variables
prefixed with `PREFECT__RUNTIME__FLOW_RUN`.

Available attributes:

* `id`: the flow run's unique ID
* `tags`: the flow run's set of tags
* `scheduled_start_time`: the flow run's expected scheduled start time; defaults to now if not present
* `name`: the name of the flow run
* `flow_name`: the name of the flow
* `flow_version`: the version of the flow
* `parameters`: the parameters that were passed to this run; note that these do not necessarily
  include default values set on the flow function, only the parameter values explicitly passed for the run
* `parent_flow_run_id`: the ID of the flow run that triggered this run, if any
* `parent_deployment_id`: the ID of the deployment that triggered this run, if any
* `run_count`: the number of times this flow run has been run

## Functions

### `get_id` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L136" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_id() -> Optional[str]
```

### `get_tags` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L148" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_tags() -> List[str]
```

### `get_run_count` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L163" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_run_count() -> int
```

### `get_name` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L178" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_name() -> Optional[str]
```

### `get_flow_name` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L193" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_flow_name() -> Optional[str]
```

### `get_flow_version` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L208" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_flow_version() -> Optional[str]
```

### `get_scheduled_start_time` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L223" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_scheduled_start_time() -> DateTime
```

### `get_parameters` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L238" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_parameters() -> Dict[str, Any]
```

### `get_parent_flow_run_id` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L254" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_parent_flow_run_id() -> Optional[str]
```

### `get_parent_deployment_id` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L276" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_parent_deployment_id() -> Optional[str]
```

### `get_root_flow_run_id` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L295" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_root_flow_run_id() -> str
```

### `get_flow_run_api_url` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L319" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_flow_run_api_url() -> Optional[str]
```

### `get_flow_run_ui_url` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L326" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_flow_run_ui_url() -> Optional[str]
```

### `get_job_variables` <sup><a href="https://github.com/PrefectHQ/prefect/blob/main/src/prefect/runtime/flow_run.py#L333" target="_blank"><Icon icon="github" style="width: 14px; height: 14px;" /></a></sup>

```python  theme={null}
get_job_variables() -> Optional[Dict[str, Any]]
```


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