WorkflowRunNotFoundError

Thrown when operating on a workflow run that does not exist.

WorkflowRunNotFoundError is thrown when performing operations on a workflow run that does not exist. This includes calling methods like run.status, run.cancel(), or awaiting run.returnValue on a run whose ID does not match any known workflow run.

getRun(id) itself is synchronous and will not throw. Subsequent operations on the run object raise the error when they discover the run is missing.

import { WorkflowRunNotFoundError } from "workflow/errors"
declare const run: { status: Promise<string>; returnValue: Promise<any> }; // @setup

try {
  const status = await run.status;
} catch (error) {
  if (WorkflowRunNotFoundError.is(error)) {
    console.error(`Run ${error.runId} does not exist`);
  }
}

API signature

Properties

NameTypeDescription
runIdstringThe ID of the run that was not found.
messagestringThe error message.

Static methods

WorkflowRunNotFoundError.is(value)

Type-safe check for WorkflowRunNotFoundError instances. Preferred over instanceof because it works across module boundaries and virtual machine contexts.

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

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