Skip to content

jobFlow()

Chain multiple job queues into a workflow. When a job completes in a source queue, its result is published to the destination queue (optionally transformed).

Signature

ts
function jobFlow(
	queues: Record<string, JobQueue<any, any>>,
	edges: JobFlowEdge[],
	opts?: JobFlowOptions,
): JobFlow

Parameters

ParameterTypeDescription
queuesRecord&lt;string, JobQueue&lt;any, any&gt;&gt;Named record of job queues.
edgesJobFlowEdge[]Wiring edges describing which queue outputs feed into which queue inputs.
optsJobFlowOptionsOptional configuration (name).

Returns

JobFlow — a multi-queue workflow with diagram export and lifecycle.

Released under the MIT License.