---
title: Query the Flux version
description: Use runtime.version() to return the version of Flux installed in InfluxDB.
url: https://docs.influxdata.com/influxdb/v2/query-data/flux/flux-version/
estimated_tokens: 2232
product: InfluxDB OSS v2
version: v2
---

# Query the Flux version

This page documents an earlier version of InfluxDB OSS. [InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a copy of the database file doesn’t expose usable tokens. Existing tokens are hashed on first startup and the original strings can’t be recovered afterward — **capture any plaintext tokens you still need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

InfluxDB 2.9 includes specific version of Flux that may or may not support documented Flux functionality. It’s important to know what version of Flux you’re currently using and what functions are supported in that specific version.

To query the version of Flux installed with InfluxDB, use `array.from()` to create an ad hoc stream of tables and `runtime.version()` to populate a column with the Flux version.

Because the InfluxDB `/api/v2/query` endpoint can only return a stream of tables and not single scalar values, you must use `array.from()` to create a stream of tables.

Run the following query in the **InfluxDB user interface**, with the **`influx` CLI**, or **InfluxDB API**:

```js
import "array"
import "runtime"

array.from(rows: [{version: runtime.version()}])
```

<!-- Tabbed content: Select one of the following options -->

**InfluxDB UI:**

To return the version of Flux installed with InfluxDB using the InfluxDB UI:

1. Click **Data Explorer** in the left navigation bar.

Data Explorer

2. Click **Script Editor** to manually create and edit a Flux query.
    
3. Enable the **View Raw Data** toggle or select one of the following visualization types:
    
    -   [Single Stat](/influxdb/v2/visualize-data/visualization-types/single-stat/)
    -   [Table](/influxdb/v2/visualize-data/visualization-types/table/)
4. Enter and run the following query:
    
    ```js
    import "array"
    import "runtime"
    
    array.from(rows: [{version: runtime.version()}])
    ```

**influx CLI:**

To return the version of Flux installed with InfluxDB using the `influx` CLI, use the `influx query` command. Provide the following:

-   InfluxDB **host**, **organization**, and **API token**  
    *(the example below assumes that a [CLI configuration](/influxdb/v2/reference/cli/influx/#provide-required-authentication-credentials) is set up and active)*
-   Query to execute

```sh
$ influx query \
  'import "array"
   import "runtime"

   array.from(rows: [{version: runtime.version()}])'

# Output
Result: _result
Table: keys: []
        version:string
----------------------
              v0.161.0
```

**InfluxDB API:**

To return the version of Flux installed with InfluxDB using the InfluxDB API, use the [`/api/v2/query` endpoint](/influxdb/v2/api/query-data/).

[POST http://localhost:8086/api/v2/query](/influxdb/v2/api/query-data/)

Provide the following:

-   InfluxDB host
-   InfluxDB organization name or ID as a query parameter
-   `Authorization` header with the `Token` scheme and your API token
-   `Accept: application/csv` header
-   `Content-type: application/vnd.flux` header
-   Query to execute as the request body

```sh
curl --request POST \
  http://localhost:8086/api/v2/query?orgID=INFLUX_ORG_ID \
  --header 'Authorization: Token INFLUX_TOKEN' \
  --header 'Accept: application/csv' \
  --header 'Content-type: application/vnd.flux' \
  --data 'import "array"
    import "runtime"

    array.from(rows: [{version: runtime.version()}])'

# Output
,result,table,version
,_result,0,v0.161.0
```

<!-- End tabbed content -->

#### Flux version in the Flux REPL

When you run `runtime.version()` in the [Flux REPL](/influxdb/v2/tools/flux-repl/), the function returns the version of Flux the REPL was built with, not the version of Flux installed in the instance of InfluxDB you’re querying.

#### Related

-   [runtime.version() function](/flux/v0/stdlib/runtime/version/)

[query](/influxdb/v2/tags/query/)
