---
url: /process-functions/cube-getflows.md
description: Returns the data flows into and out of a cube.
---

# cube.getFlows

Returns the data flows into and out of a cube. Flows are recorded when they happen, so a process only appears once it has actually read from or written to the cube.

```js
cube.getFlows(cubeName)
```

## Parameters

| Parameter | Type | Description |
|---|---|---|
| `cubeName` | `string` | The cube's name or id. |

## Returns

An object with two lists, or `null` when the cube can't be found:

* `destinations`: the flows into the cube, such as processes that have written to it with [cube.set](/process-functions/cube-set) or [cube.increment](/process-functions/cube-increment).
* `sources`: the flows out of the cube, such as processes that have read from it with [cube.get](/process-functions/cube-get).

Each flow has a `source`, a `destination`, a `type` (`Process`, `Datasource` or `Formula`) and `last_modified`, the time it was last used.

## Examples

::: code-group

```js [flows.js]
const flows = cube.getFlows("Sales");
```

```json [Result]
{
    "destinations": [
        {
            "source": "Load Sales",
            "destination": "Sales",
            "type": "Process",
            "last_modified": "2026-10-20T23:16:15.272Z"
        }
    ],
    "sources": []
}
```

:::

## Related

* [cube.sources](/process-functions/cube-sources): returns only the flows into a cube, as a JSON string.
