Skip to main content

Workflow

@webda/workflow


Abstract Class: Workflow

Defined in: packages/workflow/src/authoring.ts:43

Base class of the flow classes of a .flow.ts file: each async method is a flow <Class>.<Method>

Constructors​

Constructor​

new Workflow(): Workflow

Defined in: packages/workflow/src/authoring.ts:47

Flow classes are never instantiated

Returns​

Workflow

Methods​

Call()​

static Call<R>(_operationId, _input?, _options?): Promise<R>

Defined in: packages/workflow/src/authoring.ts:80

Call any operation by id, untyped: model operations (Order.Query) or operations of other packages

Type Parameters​

R​

R = any

Parameters​

_operationId​

string

the operation id, a string literal

_input?​

Record<string, any>

its input

_options?​

TaskOptions

task options

Returns​

Promise<R>

the operation result


Parallel()​

static Parallel<T, R>(_items, _fn, _options?): Promise<R[]>

Defined in: packages/workflow/src/authoring.ts:59

Run a body for each item concurrently (a map statement)

Type Parameters​

T​

T

R​

R

Parameters​

_items​

T[]

the items

_fn​

(item) => Promise<R>

a single call, or an async block, run for each item

_options?​

options

concurrency?​

number

maximum number of items running at once

Returns​

Promise<R[]>

the value of each item, in order


Start()​

static Start<I>(_flow, _input): Promise<{ uuid: string; }>

Defined in: packages/workflow/src/authoring.ts:69

Start a child flow without waiting for it

Type Parameters​

I​

I

Parameters​

_flow​

(input, options?) => Promise<any>

the child flow, as OtherFlows.Method

_input​

I

its input

Returns​

Promise<{ uuid: string; }>

the uuid of the child instance