Skip to content

Function: chain() ​

ts
function chain(
   queueName,
   jobs,
   connection,
   prefix?
): Promise<ClosableWorkflow<JobNode>>;

Defined in: glide-mq/src/workflows.ts:54

Chain: execute jobs sequentially. Each step becomes a child of the next, so step N+1 only runs after step N completes. The last job in the array runs first; the first job in the array runs last and is the top-level parent.

Returns the JobNode tree. The top-level job (jobs[0]) is the root. Pass { client } on the connection to keep returned jobs usable; otherwise the owned client is closed after submit. Call close() when using a shared client.

Parameters ​

ParameterType
queueNamestring
jobsWorkflowJobDef[]
connectionWorkflowConnection
prefix?string

Returns ​

Promise<ClosableWorkflow<JobNode>>

Released under the Apache-2.0 License.