mastra-ai/mastra · error · Error
No registry entry found for run ${runId}. Cannot resume.
Error message
No registry entry found for run ${runId}. Cannot resume. What it means
DurableAgent.resume() looks up the run first in the in-memory run registry, and when absent, in the persisted workflow storage under the AGENTIC_LOOP workflow name. If neither has a record for the given runId, resume cannot proceed and this Error is thrown. It means the runId is unknown to this agent instance and no persisted snapshot exists for it.
Source
Thrown at packages/core/src/agent/durable/durable-agent.ts:1942
*/
async resume(
runId: string,
resumeData: unknown,
options?: DurableAgentResumeOptions<TOutput>,
): Promise<DurableAgentStreamResult<TOutput>> {
let entry = this.#runRegistry.get(runId);
if (!entry) {
// A persisted durable run can outlive this process (or the registry TTL).
// Rebuild the non-serializable runtime state before resuming the stored
// workflow snapshot. Keep warm resumes on the existing path to avoid
// racing an active registry entry with a second preparation pass.
const workflowsStore = await this.#mastra?.getStorage()?.getStore('workflows');
const persisted = await workflowsStore?.getWorkflowRunById({
runId,
workflowName: DurableStepIds.AGENTIC_LOOP,
});
if (!persisted) {
throw new Error(`No registry entry found for run ${runId}. Cannot resume.`);
}
const snapshot =
typeof persisted.snapshot === 'string'
? (JSON.parse(persisted.snapshot) as WorkflowRunState)
: persisted.snapshot;
if (snapshot?.status !== 'suspended') {
throw new Error('This workflow run was not suspended');
}
const workflowInput = snapshot?.context?.input as DurableAgenticWorkflowInput | undefined;
if (!workflowInput || workflowInput.__workflowKind !== 'durable-agent') {
throw new MastraError({
id: 'DURABLE_AGENT_RESUME_INVALID_SNAPSHOT',
domain: ErrorDomain.AGENT,
category: ErrorCategory.SYSTEM,
text: `DurableAgent "${this.name}" resume(${runId}): persisted snapshot does not contain a durable-agent workflow input.`,
details: { agentName: this.name, runId },
});View on GitHub (pinned to 75dd419e61)
Solutions
- Verify the runId is the exact value returned from the original stream/resume result object.
- Check that the Mastra instance is configured with the same persistent storage backend that holds the run snapshot (e.g. PostgreSQL, LibSQL).
- Confirm the run is still in progress or suspended — completed/failed runs may have had snapshots deleted via deleteRunSnapshots.
- If the process restarted, ensure durable storage was in place at start time; runs held only in the in-memory registry cannot survive restarts.
Example fix
// before
await agent.resume(someOtherId, resumeData);
// after
const { runId } = await agent.stream('hi');
// persist runId yourself, then:
await agent.resume(runId, resumeData); Defensive patterns
Strategy: try-catch
Validate before calling
const persisted = await mastra.getStorage()?.getStore('workflows')?.getWorkflowRunById({ runId, workflowName: 'agentic-loop' });
if (!persisted) throw new Error(`Unknown run ${runId}`); Try / catch
try {
await agent.resume(runId, data);
} catch (e) {
if (String(e).includes(`No registry entry found for run ${runId}`)) {
// unknown/expired runId: start a new run or surface 404
} else throw e;
} Prevention
- Persist the runId returned by stream()/resume() at creation time.
- Always configure persistent storage for durable agents.
- Never reuse runIds across storage backends or environments.
When it happens
Trigger: Calling agent.resume(runId, data) with: a runId that was never started; a run whose snapshots were deleted (e.g. after completion or deleteRunSnapshots); a run persisted by a different Mastra storage backend than the one currently configured; a typo'd or truncated runId; or a runId from another deployment/database.
Common situations: Restarting the app with in-memory storage so old runIds are lost; pointing dev code at a different database than the one that recorded the run; passing the threadId instead of runId; resuming after the run already finished and its snapshots were cleaned up.
Related errors
- Version-control repository not found.
- Project repository not found for this organization.
- Source-control connection not found for this organization.
- Repository not found for this organization.
- Source-control installation not found for this organization.
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/9cea27623349634b.
Report an issue: GitHub.