function selectWorkflowVersion<T>(
versions,
runId,
runStore): Promise<T | undefined>;Defined in: packages/workflow-core/src/registry/select-version.ts:28
Pick the workflow version that a persisted run was started under.
Hosts running multiple versions of the same workflow side-by-side use this to route resume calls to the right code path. Each WorkflowDefinition should carry a version field (createWorkflow({ version: 'v1', ... })); the helper compares that against the workflowVersion field on the run's persisted state.
Resolution order:
const v1 = createWorkflow({ id: 'pipeline', version: 'v1' }).handler(...) const v2 = createWorkflow({ id: 'pipeline', version: 'v2' }).handler(...) const wf = await selectWorkflowVersion([v1, v2], runId, store) ?? v2 // default to latest for fresh starts / unrouted runs runWorkflow({ workflow: wf, runId, ... })
T extends AnyWorkflowDefinition
readonly T[]
string
Promise<T | undefined>