{"record":{"id":"09c539c3a8e5be98","repo":"mastra-ai/mastra","slug":"this-workflow-step-steps-0-was-not-suspend-09c539","errorCode":null,"errorMessage":"This workflow step \"${steps?.[0]}\" was not suspended. Available suspended steps: [${suspendedStepIds.join(', ')}]","messagePattern":"This workflow step \"(.+?)\" was not suspended\\. Available suspended steps: \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workflows/workflow.ts","lineNumber":4502,"sourceCode":"      if (suspendedStepPaths.length === 1) {\n        // For single suspended step, use the full path\n        steps = suspendedStepPaths[0]!;\n      } else {\n        const pathStrings = suspendedStepPaths.map(path => `[${path.join(', ')}]`);\n        throw new Error(\n          `Multiple suspended steps found: ${pathStrings.join(', ')}. ` +\n            'Please specify which step to resume using the \"step\" parameter.',\n        );\n      }\n    }\n\n    if (!params.retryCount) {\n      const suspendedStepIds = Object.keys(snapshot?.suspendedPaths ?? {});\n\n      const isStepSuspended = suspendedStepIds.includes(steps?.[0] ?? '');\n\n      if (!isStepSuspended) {\n        throw new Error(\n          `This workflow step \"${steps?.[0]}\" was not suspended. Available suspended steps: [${suspendedStepIds.join(', ')}]`,\n        );\n      }\n    }\n\n    const suspendedStep = this.workflowSteps[steps?.[0] ?? ''];\n\n    const resumeDataToUse = await this._validateResumeData(params.resumeData, suspendedStep);\n\n    let requestContextInput;\n    if (params.retryCount && params.retryCount > 0 && params.requestContext) {\n      requestContextInput = (params.requestContext as RequestContext).get('__mastraWorflowInputData');\n      (params.requestContext as RequestContext).delete('__mastraWorflowInputData');\n    }\n\n    const stepResults = { ...(snapshot?.context ?? {}), input: requestContextInput ?? snapshot?.context?.input } as any;\n\n    const requestContextToUse = params.requestContext ?? new RequestContext();","sourceCodeStart":4484,"sourceCodeEnd":4520,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/workflow.ts#L4484-L4520","documentation":"Thrown when the step requested in resume() (steps[0]) is not among the snapshot's suspendedPaths keys and no retryCount is set. The run is suspended, but not at the requested step; available suspended step IDs are listed in the message.","triggerScenarios":"Passing a wrong/renamed step id to resume(); resuming a step that already completed; using the nested child step id where the parent step id is expected in suspendedPaths; label lookup didn't resolve so params.step fell through with a wrong id.","commonSituations":"Workflow definition refactored and step ids changed while old clients still resume the old ids; typos in step names; resuming nested workflow steps with only the child step name; passing a Step object whose id differs from the suspended path key.","solutions":["Use a suspended step id exactly as listed in the error (or in snapshot.suspendedPaths).","For nested workflows, supply the full path, e.g. step: ['parentStep', 'childStep'] or 'parentStep.childStep'.","Sync step ids with the current workflow definition after renames; resume with the step object imported from the workflow file so ids stay in sync.","Check resumeLabels: use { label } to resume a labelled suspension instead of hardcoding the step id."],"exampleFix":"// before\nawait run.resume({ resumeData, step: 'humanInput' }); // renamed\n// after\nimport { humanInputStep } from './steps';\nawait run.resume({ resumeData, step: humanInputStep }); // keeps id in sync","handlingStrategy":"validation","validationCode":"const snapshot = await run.getWorkflowRunState();\nconst stepId = typeof step === 'string' ? step : step.id;\nif (!Object.keys(snapshot.suspendedPaths ?? {}).includes(stepId.split('.')[0])) {\n  throw new Error(`Step ${stepId} is not currently suspended`);\n}","typeGuard":"function isStepSuspended(s: { suspendedPaths?: Record<string, unknown> }, stepId: string): boolean {\n  return stepId.split('.').length > 0 && Object.keys(s.suspendedPaths ?? {}).includes(stepId.split('.')[0]);\n}","tryCatchPattern":"try {\n  await run.resume({ resumeData, step });\n} catch (e) {\n  if (e instanceof Error && e.message.includes('was not suspended. Available suspended steps')) {\n    // re-read suspendedPaths and resume the correct step\n  } else throw e;\n}","preventionTips":["Import Step objects and pass them (not string literals) so ids stay in sync.","For nested suspensions, use the full dotted path.","Use labelled suspensions ({ label }) instead of hardcoding step ids.","Re-read suspendedPaths whenever the workflow definition changed."],"tags":["workflow","resume","step-id","validation"],"backgroundTag":"workflow-step-not-suspended","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}