Skip to main content

Function: dynamicWorkflow()

Call Signature​

dynamicWorkflow<Out>(name, options, fn): DurableWorkflow<Json, Out>

Declare a dynamic workflow (11 §2.29): it runs for every workflowFn the bundle does not export, and receives the requested name. lower() writes it to code.exports.workflows["*"], so a start or a child naming any function of the workflow key reaches it. One per bundle.

Type Parameters​

Out​

Out = Json

Parameters​

name​

string

options​

DurableWorkflowOptions

fn​

(ctx, workflowFn, input) => Promise<Out>

Returns​

DurableWorkflow<Json, Out>

Call Signature​

dynamicWorkflow<Out>(name, fn): DurableWorkflow<Json, Out>

Declare a dynamic workflow (11 §2.29): it runs for every workflowFn the bundle does not export, and receives the requested name. lower() writes it to code.exports.workflows["*"], so a start or a child naming any function of the workflow key reaches it. One per bundle.

Type Parameters​

Out​

Out = Json

Parameters​

name​

string

fn​

(ctx, workflowFn, input) => Promise<Out>

Returns​

DurableWorkflow<Json, Out>