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

***

# Function: rmFlowById()

> **rmFlowById**(`directory`): (`id`, `version`?, `persistFiles`?) => `Promise`<`void`>

Defined in: flows.ts:271

Delete a flow by its id.

Optionally specify a version to delete a specific version of the flow.

## 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      |
| --------------- | --------- |
| `id`            | `string`  |
| `version`?      | `string`  |
| `persistFiles`? | `boolean` |

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

`Promise`<`void`>

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

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

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

// deletes the latest PaymentFlow flow
await rmFlowById('PaymentFlow');

// deletes a specific version of the PaymentFlow flow
await rmFlowById('PaymentFlow', '0.0.1');
```
