Copy as Markdown[View as Markdown](/docs/sdk/functions/getFlows.md)

***

# Function: getFlows()

> **getFlows**(`directory`): (`options`?) => `Promise`<`Flow`\[]>

Defined in: flows.ts:62

Returns all flows from EventCatalog.

You can optionally specify if you want to get the latest version of the flows.

## Parameters[​](#parameters "Direct link to Parameters")

| Parameter   | Type     |
| ----------- | -------- |
| `directory` | `string` |

## Returns[​](#returns "Direct link to Returns")

`Function`

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Parameter             | Type                         |
| --------------------- | ---------------------------- |
| `options`?            | { `latestOnly`: `boolean`; } |
| `options.latestOnly`? | `boolean`                    |

### Returns[​](#returns-1 "Direct link to Returns")

`Promise`<`Flow`\[]>

## Example[​](#example "Direct link to Example")

```
import utils from '@eventcatalog/utils';

const { getFlows } = utils('/path/to/eventcatalog');

// Gets all flows (and versions) from the catalog
const flows = await getFlows();

// Gets all flows (only latest version) from the catalog
const flows = await getFlows({ latestOnly: true });
```
