RunNotSupportedError

Thrown when a workflow run requires a newer workflow spec version than the installed SDK supports.

RunNotSupportedError is thrown when reading a workflow run whose data was written with a newer workflow spec version than the running SDK supports. This typically means the run was created by a newer version of the workflow package — upgrade the package to process it.

import { RunNotSupportedError } from "workflow/errors"
declare function readRun(runId: string): Promise<unknown>; // @setup
declare const runId: string; // @setup

try {
  await readRun(runId);
} catch (error) {
  if (RunNotSupportedError.is(error)) {
    console.error(
      `Run requires spec v${error.runSpecVersion}, world supports v${error.worldSpecVersion}`
    );
  }
}

API Signature

Properties

NameTypeDescription
runSpecVersionnumberThe spec version the run's stored data requires.
worldSpecVersionnumberThe spec version the current World supports.
messagestringThe error message.

Static Methods

RunNotSupportedError.is(value)

Type-safe check for RunNotSupportedError instances. Preferred over instanceof because it works across module boundaries and VM contexts.

import { RunNotSupportedError } from "workflow/errors"
declare const error: unknown; // @setup

if (RunNotSupportedError.is(error)) {
  // error is typed as RunNotSupportedError
}