Thrown when requesting the result of a workflow run that has not completed yet.
WorkflowRunNotCompletedError is thrown when requesting the result of a workflow run that has not completed yet. The run's current status (for example pending or running) is available on the error.
run.returnValue() handles this error internally — it polls until the run completes — so you will mainly encounter it when building custom polling logic on lower-level APIs.
import { WorkflowRunNotCompletedError } from "workflow/errors"
declare function readRunResult(runId: string): Promise<unknown>; // @setup
declare const runId: string; // @setup
try {
const result = await readRunResult(runId);
} catch (error) {
if (WorkflowRunNotCompletedError.is(error)) {
console.log(`Run ${error.runId} is still ${error.status}`);
}
}Properties
| Name | Type | Description |
|---|---|---|
runId | string | The workflow run ID. |
status | string | The run's status at the time of the error (e.g. "pending", "running"). |
message | string | The error message. |
Static Methods
WorkflowRunNotCompletedError.is(value)
Type-safe check for WorkflowRunNotCompletedError instances. Preferred over instanceof because it works across module boundaries and VM contexts.
import { WorkflowRunNotCompletedError } from "workflow/errors"
declare const error: unknown; // @setup
if (WorkflowRunNotCompletedError.is(error)) {
// error is typed as WorkflowRunNotCompletedError
}






