RunExpiredError

Thrown when a workflow run has expired and can no longer be operated on.

RunExpiredError is thrown by world implementations when a workflow run has expired and can no longer be operated on. It corresponds to HTTP 410 Gone semantics.

The Workflow runtime handles this error automatically. You will only encounter it when interacting with world storage APIs directly.

import { RunExpiredError } from "workflow/errors"
declare const world: { events: { create(...args: any[]): Promise<any> } }; // @setup
declare const runId: string; // @setup
declare const event: any; // @setup

try {
  await world.events.create(runId, event);
} catch (error) {
  if (RunExpiredError.is(error)) {
    console.log("Run has expired and can no longer accept events");
  }
}

API Signature

Properties

NameTypeDescription
messagestringThe error message.

Static Methods

RunExpiredError.is(value)

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

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

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