{"record":{"id":"246e07f4364d799a","repo":"mastra-ai/mastra","slug":"resume-label-params-label-not-found-availabl","errorCode":null,"errorMessage":"Resume label \"${params.label}\" not found. Available labels: [${availableLabels.join(', ')}]","messagePattern":"Resume label \"(.+?)\" not found\\. Available labels: \\[(.+?)\\]","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/workflows/evented/workflow.ts","lineNumber":2345,"sourceCode":"      throw new Error('Cannot resume workflow: workflows store is required');\n    }\n    const snapshot = await waitForSuspendedSnapshot(workflowsStore, this.workflowId, this.runId);\n    if (!snapshot) {\n      throw new Error(`Cannot resume workflow: no snapshot found for runId ${this.runId}`);\n    }\n\n    // Check if workflow is suspended before proceeding\n    if (snapshot.status !== 'suspended') {\n      throw new Error('This workflow run was not suspended');\n    }\n\n    // Resolve label to step path if provided\n    const snapshotResumeLabel = params.label ? snapshot?.resumeLabels?.[params.label] : undefined;\n\n    // Validate label exists if provided\n    if (params.label && !snapshotResumeLabel) {\n      const availableLabels = Object.keys(snapshot?.resumeLabels ?? {});\n      throw new Error(\n        `Resume label \"${params.label}\" not found. ` + `Available labels: [${availableLabels.join(', ')}]`,\n      );\n    }\n\n    // Label takes precedence over step param\n    const stepParam = snapshotResumeLabel?.stepId ?? params.step;\n\n    // Auto-detect suspended steps if no step is provided\n    let steps: string[];\n    if (stepParam) {\n      if (typeof stepParam === 'string') {\n        steps = stepParam.split('.');\n      } else {\n        steps = (Array.isArray(stepParam) ? stepParam : [stepParam]).map(step =>\n          typeof step === 'string' ? step : step?.id,\n        );\n      }\n    } else {","sourceCodeStart":2327,"sourceCodeEnd":2363,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/evented/workflow.ts#L2327-L2363","documentation":"When resume() is called with a label, the library looks it up in snapshot.resumeLabels (populated by suspend() calls with labels). The label isn't present, so it throws with the list of labels that ARE available to help the caller pick a valid one.","triggerScenarios":"Calling resume({ label: 'myLabel', ... }) where snapshot.resumeLabels is undefined, empty, or doesn't contain 'myLabel' — label typo, suspend executed without a label, or resuming against the wrong run whose suspension points differ.","commonSituations":"Renaming a label in the step's suspend() but not at all resume call sites; resuming a different run than intended (labels differ per run path); label defined only on a branch that wasn't taken.","solutions":["Copy the label string exactly from the suspend({ label }) call (check the available labels listed in the error)","Log or inspect snapshot.resumeLabels for the run and resume using one of those keys","Use the step id + resumeData form of resume() instead of a label if labels aren't reliably set"],"exampleFix":"// before\nawait run.resume({ label: 'approve', resumeData: { ok: true } });\n// error says available: [approval]\n// after\nawait run.resume({ label: 'approval', resumeData: { ok: true } });","handlingStrategy":"validation","validationCode":"const snapshot = await storage.loadWorkflowSnapshot({ workflowId, runId });\nconst labels = Object.keys(snapshot?.resumeLabels ?? {});\nif (label && !labels.includes(label)) {\n  throw new Error(`Label ${label} not in available: ${labels.join(', ')}`);\n}","typeGuard":"function hasResumeLabel(s, label) {\n  return Boolean(s?.resumeLabels && label in s.resumeLabels);\n}","tryCatchPattern":"try {\n  await run.resume({ runId, label, resumeData });\n} catch (e) {\n  if (e.message.includes('Resume label')) {\n    // parse available labels from message and retry with a valid one, or resume by step\n    throw e;\n  }\n  throw e;\n}","preventionTips":["Define label constants shared by suspend() and resume() call sites","Search the codebase for suspend({ label }) when renaming labels","Prefer resuming by step id when labels are dynamic"],"tags":["workflow","resume","label","configuration"],"backgroundTag":"resume-label-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}