{"record":{"id":"9cea27623349634b","repo":"mastra-ai/mastra","slug":"no-registry-entry-found-for-run-runid-cannot-r","errorCode":null,"errorMessage":"No registry entry found for run ${runId}. Cannot resume.","messagePattern":"No registry entry found for run (.+?)\\. Cannot resume\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/agent/durable/durable-agent.ts","lineNumber":1942,"sourceCode":"   */\n  async resume(\n    runId: string,\n    resumeData: unknown,\n    options?: DurableAgentResumeOptions<TOutput>,\n  ): Promise<DurableAgentStreamResult<TOutput>> {\n    let entry = this.#runRegistry.get(runId);\n    if (!entry) {\n      // A persisted durable run can outlive this process (or the registry TTL).\n      // Rebuild the non-serializable runtime state before resuming the stored\n      // workflow snapshot. Keep warm resumes on the existing path to avoid\n      // racing an active registry entry with a second preparation pass.\n      const workflowsStore = await this.#mastra?.getStorage()?.getStore('workflows');\n      const persisted = await workflowsStore?.getWorkflowRunById({\n        runId,\n        workflowName: DurableStepIds.AGENTIC_LOOP,\n      });\n      if (!persisted) {\n        throw new Error(`No registry entry found for run ${runId}. Cannot resume.`);\n      }\n\n      const snapshot =\n        typeof persisted.snapshot === 'string'\n          ? (JSON.parse(persisted.snapshot) as WorkflowRunState)\n          : persisted.snapshot;\n      if (snapshot?.status !== 'suspended') {\n        throw new Error('This workflow run was not suspended');\n      }\n      const workflowInput = snapshot?.context?.input as DurableAgenticWorkflowInput | undefined;\n      if (!workflowInput || workflowInput.__workflowKind !== 'durable-agent') {\n        throw new MastraError({\n          id: 'DURABLE_AGENT_RESUME_INVALID_SNAPSHOT',\n          domain: ErrorDomain.AGENT,\n          category: ErrorCategory.SYSTEM,\n          text: `DurableAgent \"${this.name}\" resume(${runId}): persisted snapshot does not contain a durable-agent workflow input.`,\n          details: { agentName: this.name, runId },\n        });","sourceCodeStart":1924,"sourceCodeEnd":1960,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/agent/durable/durable-agent.ts#L1924-L1960","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nawait agent.resume(someOtherId, resumeData);\n// after\nconst { runId } = await agent.stream('hi');\n// persist runId yourself, then:\nawait agent.resume(runId, resumeData);","handlingStrategy":"try-catch","validationCode":"const persisted = await mastra.getStorage()?.getStore('workflows')?.getWorkflowRunById({ runId, workflowName: 'agentic-loop' });\nif (!persisted) throw new Error(`Unknown run ${runId}`);","typeGuard":null,"tryCatchPattern":"try {\n  await agent.resume(runId, data);\n} catch (e) {\n  if (String(e).includes(`No registry entry found for run ${runId}`)) {\n    // unknown/expired runId: start a new run or surface 404\n  } else throw e;\n}","preventionTips":["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."],"tags":["durable-agent","resume","not-found","storage"],"backgroundTag":"run-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}