---
url: /process-functions/cube-sources.md
description: Returns what feeds data into a cube.
---

# cube.sources

Returns what feeds data into a cube, such as the processes that write to it with [cube.set](/process-functions/cube-set) or [cube.increment](/process-functions/cube-increment). A process is only added once it has actually written to the cube.

```js
cube.sources(cubeName)
```

## Parameters

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

## Returns

The feeds into the cube as a JSON string, read with `JSON.parse()`, or `"Error: Cube not found."` when the cube can't be found.

`type` is `Process`, `Datasource` or `Formula`, and `last_modified` is a Unix timestamp in milliseconds.

## Examples

::: code-group

```js [sources.js]
const sources = JSON.parse(cube.sources("Sales"));
```

```json [Result]
[
    {
        "source": "Load Sales",
        "destination": "Sales",
        "source_id": "p-7g8h9i",
        "destination_id": "c-4d5e6f",
        "model_id": "m-1a2b3c",
        "last_modified": 1760486400000,
        "type": "Process"
    }
]
```

:::

## Related

* [cube.getFlows](/process-functions/cube-getflows): returns the flows into and out of a cube, as an object.
