{"record":{"id":"bea7c976c9b1a293","repo":"mastra-ai/mastra","slug":"no-snapshot-found-for-this-workflow-run-this-wo","errorCode":null,"errorMessage":"No snapshot found for this workflow run: ${this.workflowId} ${this.runId}","messagePattern":"No snapshot found for this workflow run: (.+?) (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workflows/workflow.ts","lineNumber":4366,"sourceCode":"    const claimed = await workflowsStore.updateWorkflowState({\n      workflowName: this.workflowId,\n      runId: this.runId,\n      opts: { status: 'running', expectedStatus: 'suspended' },\n    });\n\n    if (claimed) {\n      return;\n    }\n\n    // The compare-and-set found a status other than `suspended`. Re-read so the error names the\n    // status the run actually landed in rather than guessing.\n    const current = await workflowsStore.loadWorkflowSnapshot({\n      workflowName: this.workflowId,\n      runId: this.runId,\n    });\n\n    if (!current) {\n      throw new Error('No snapshot found for this workflow run: ' + this.workflowId + ' ' + this.runId);\n    }\n\n    throw new MastraError({\n      id: 'WORKFLOW_RESUME_ALREADY_CLAIMED',\n      domain: ErrorDomain.MASTRA_WORKFLOW,\n      category: ErrorCategory.USER,\n      text:\n        `This suspended workflow run was already resumed by another caller. Workflow \"${this.workflowId}\" run \"${this.runId}\" ` +\n        `moved from \"${snapshot.status}\" to \"${current.status}\" before this resume could claim it. ` +\n        `Only one resume() call may continue a given suspension; re-read the run state before resuming again.`,\n      details: {\n        workflowId: this.workflowId,\n        runId: this.runId,\n        expectedStatus: 'suspended',\n        actualStatus: current.status ?? 'unknown',\n      },\n    });\n  }","sourceCodeStart":4348,"sourceCodeEnd":4384,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/workflow.ts#L4348-L4384","documentation":"Thrown during resume claim verification in workflow.ts: when a concurrent-update-enabled store's compare-and-set shows the snapshot status is no longer 'suspended', the code re-reads the snapshot to report the actual status. If that re-read returns nothing (snapshot deleted or missing), this plain Error is thrown. It means the workflow run's persisted snapshot cannot be found for the given workflowId/runId pair.","triggerScenarios":"Calling workflow.resume() on a run whose snapshot was deleted from storage, or whose runId does not exist in the configured workflow store, after the optimistic status check found the run non-suspended.","commonSituations":"Wrong storage backend configured (e.g. in-memory store restarted, losing snapshots); runId typo or run created against a different Mastra instance; snapshot TTL/cleanup removed the run; pointing app at a different database than the one that created the run.","solutions":["Verify the runId exists: inspect the workflow storage table (workflows_snapshots) for workflowName + runId before resuming.","Check that the same storage/DB instance is used across processes (MASTRA_STORAGE / libsql/upstash config not pointing at two different DBs).","Re-create the run if the snapshot was legitimately deleted; snapshots cannot be reconstructed.","Confirm the storage adapter implements loadWorkflowSnapshot and supports concurrent updates if relying on claim semantics."],"exampleFix":"// before\nawait run.resume({ resumeData, step: 'myStep' }); // throws: no snapshot\n// after\nconst snapshot = await storage.loadWorkflowSnapshot({ workflowName: wf.id, runId: runId });\nif (!snapshot) throw new Error(`Run ${runId} not found in storage`);\nawait run.resume({ resumeData, step: 'myStep' });","handlingStrategy":"try-catch","validationCode":"const store = await mastra.getStorage()?.getStore('workflows');\nconst snapshot = await store?.loadWorkflowSnapshot({ workflowName: wf.id, runId });\nif (!snapshot) throw new Error(`Run ${runId} has no snapshot; cannot resume`);","typeGuard":"function hasSnapshot(s: unknown): s is { status: string } {\n  return !!s && typeof s === 'object' && 'status' in s;\n}","tryCatchPattern":"try {\n  await run.resume({ resumeData, step: 'myStep' });\n} catch (e) {\n  if (e instanceof Error && /No snapshot found for this workflow run/.test(e.message)) {\n    // re-create the run or correct the storage config\n  } else throw e;\n}","preventionTips":["Always persist snapshots in a durable store (never in-memory) in production.","Share one storage instance/DB across all processes that resume runs.","Validate runId exists before resume in API handlers.","Log and monitor storage lookups that return null."],"tags":["workflow","storage","resume","snapshot"],"backgroundTag":"workflow-snapshot-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}