defineWorkflowJob
Purpose and behavior
Section titled “Purpose and behavior”Return a queue handler that builds a workflow from each trigger job input and starts it under the job runId, with the job signal and checkpoint.version plus an input digest as checkpoint version. The job value summarizes the run (status, tasks, paused gates, input requests) with its token usage; a failed or cancelled workflow, or an incompatible checkpoint, completes the job with an error. Creation throws without a workflow factory, checkpoint store and version.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsRequiredWorkflowJobOptionsWorkflow factory, checkpoint settings and start options.options.workflowRequired(input: WorkflowJson, context: WorkflowJobContext) => Workflow | Promise<Workflow>Build the workflow for one job input; the same input must build the same workflow, and it may be asynchronous.options.checkpointRequiredWorkflowJobCheckpointCheckpoint store and base version shared by every job; creation throws without both.options.startOptionalWorkflowJobStartOptions | undefinedOther workflow start options, such as concurrency, budget, onQuota or timeoutMs; checkpoint, signal, decisions and answers are managed by the job.