Skip to main content
View as Markdown

Function: getFlow()

getFlow(directory): (id, version?) => Promise<Flow>

Defined in: flows.ts:38

Returns a flow from EventCatalog.

You can optionally specify a version to get a specific version of the flow

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring
version?string

Returns

Promise<Flow>

Example

import utils from '@eventcatalog/utils';

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

// Gets the latest version of the flow
const flow = await getFlow('PaymentFlow');

// Gets a version of the flow
const flow = await getFlow('PaymentFlow', '0.0.1');