coleam00/Archon · error
Cannot resume run with status '${run.status}'. Only failed o
Error message
Cannot resume run with status '${run.status}'. Only failed or paused runs can be resumed. What it means
resumeWorkflow validates that a run can be resumed before executing it. Only 'failed' and 'paused' runs are in RESUMABLE_WORKFLOW_STATUSES; any other status (running, completed, cancelled, etc.) has no execution point to resume from, so the library throws rather than corrupting run state.
Source
Thrown at packages/core/src/operations/workflow-operations.ts:398
/**
* List all running and paused workflow runs.
*/
export async function getWorkflowStatus(): Promise<WorkflowStatusData> {
const runs = await workflowDb.listWorkflowRuns({
status: ['running', 'paused'],
limit: 50,
});
return { runs };
}
/**
* Validate that a run can be resumed and return it.
* Does NOT execute the workflow — callers decide whether to run.
*/
export async function resumeWorkflow(runId: string): Promise<WorkflowRun> {
const run = await getRunOrThrow(runId, 'operations.workflow_resume_lookup_failed');
if (!RESUMABLE_WORKFLOW_STATUSES.includes(run.status)) {
throw new Error(
`Cannot resume run with status '${run.status}'. Only failed or paused runs can be resumed.`
);
}
return run;
}
export interface AbandonWorkflowResult {
run: WorkflowRun;
/** Whether this call won the state transition to `cancelled`. */
cancelled: boolean;
/**
* Number of sub-run descendants the cascade failed to cancel (best-effort walk;
* failures are also logged). Non-zero means part of the tree may still be alive.
*/
cascadeFailures: number;
/**
* When the abandoned run was itself a `workflow:` sub-run and its parent is
* paused blocked on it: the parent's run id. Nothing auto-resumes that parentView on GitHub (pinned to 0773b97458)
Solutions
- Check the run's status first and only call resumeWorkflow when status is 'failed' or 'paused'.
- If the run already completed, start a new run instead of resuming.
- If the run is currently 'running', wait for it to finish; use cancel/abandon if it must stop.
- A cancelled run is terminal — start a fresh run rather than resuming.
Example fix
// before
await resumeWorkflow(runId);
// after
const run = await getRunOrThrow(runId);
if (run.status === 'failed' || run.status === 'paused') {
await resumeWorkflow(runId);
} Defensive patterns
Strategy: validation
Validate before calling
const RESUMABLE = ['failed', 'paused'];
const run = await getRun(runId);
if (!RESUMABLE.includes(run.status)) throw new Error(`Run ${runId} (${run.status}) is not resumable`); Type guard
function isResumable(run: WorkflowRun): boolean {
return run.status === 'failed' || run.status === 'paused';
} Try / catch
try { await resumeWorkflow(runId); }
catch (e) {
if ((e as Error).message.startsWith("Cannot resume run with status")) {
console.warn(`Not resumable: ${(e as Error).message}`);
} else throw e;
} Prevention
- Check status right before resuming; refresh stale run listings.
- Start new runs for completed/cancelled work instead of resuming.
- Guard automation retry loops with a resumable-status predicate.
When it happens
Trigger: Calling resumeWorkflow (directly or via the 'run'/'resumed' commands) with a run ID whose status is 'running', 'completed', or 'cancelled'.
Common situations: Resuming an already-completed run from a stale task list; attempting to kick a run that is currently executing; retrying a resume command that already succeeded; a cancelled run referenced by an old automation script.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- Workflow run '${resolvedId}' has no working path recorded. C
- Failed to resume workflow '${run.workflow_name}': ${err.mess
- Approved but failed to resume workflow '${result.workflowNam
- Rejected but failed to resume workflow '${result.workflowNam
- Response recorded but failed to resume workflow '${result.wo
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/bae7990b998d0f1a.
Report an issue: GitHub.