mastra-ai/mastra · error
This workflow step "${steps?.[0]}" was not suspended. Availa
Error message
This workflow step "${steps?.[0]}" was not suspended. Available suspended steps: [${suspendedStepIds.join(', ')}] What it means
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.
Source
Thrown at packages/core/src/workflows/workflow.ts:4502
if (suspendedStepPaths.length === 1) {
// For single suspended step, use the full path
steps = suspendedStepPaths[0]!;
} else {
const pathStrings = suspendedStepPaths.map(path => `[${path.join(', ')}]`);
throw new Error(
`Multiple suspended steps found: ${pathStrings.join(', ')}. ` +
'Please specify which step to resume using the "step" parameter.',
);
}
}
if (!params.retryCount) {
const suspendedStepIds = Object.keys(snapshot?.suspendedPaths ?? {});
const isStepSuspended = suspendedStepIds.includes(steps?.[0] ?? '');
if (!isStepSuspended) {
throw new Error(
`This workflow step "${steps?.[0]}" was not suspended. Available suspended steps: [${suspendedStepIds.join(', ')}]`,
);
}
}
const suspendedStep = this.workflowSteps[steps?.[0] ?? ''];
const resumeDataToUse = await this._validateResumeData(params.resumeData, suspendedStep);
let requestContextInput;
if (params.retryCount && params.retryCount > 0 && params.requestContext) {
requestContextInput = (params.requestContext as RequestContext).get('__mastraWorflowInputData');
(params.requestContext as RequestContext).delete('__mastraWorflowInputData');
}
const stepResults = { ...(snapshot?.context ?? {}), input: requestContextInput ?? snapshot?.context?.input } as any;
const requestContextToUse = params.requestContext ?? new RequestContext();View on GitHub (pinned to 75dd419e61)
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.
Example fix
// before
await run.resume({ resumeData, step: 'humanInput' }); // renamed
// after
import { humanInputStep } from './steps';
await run.resume({ resumeData, step: humanInputStep }); // keeps id in sync Defensive patterns
Strategy: validation
Validate before calling
const snapshot = await run.getWorkflowRunState();
const stepId = typeof step === 'string' ? step : step.id;
if (!Object.keys(snapshot.suspendedPaths ?? {}).includes(stepId.split('.')[0])) {
throw new Error(`Step ${stepId} is not currently suspended`);
} Type guard
function isStepSuspended(s: { suspendedPaths?: Record<string, unknown> }, stepId: string): boolean {
return stepId.split('.').length > 0 && Object.keys(s.suspendedPaths ?? {}).includes(stepId.split('.')[0]);
} Try / catch
try {
await run.resume({ resumeData, step });
} catch (e) {
if (e instanceof Error && e.message.includes('was not suspended. Available suspended steps')) {
// re-read suspendedPaths and resume the correct step
} else throw e;
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- This workflow step "${steps?.[0]}" was not suspended. Availa
- Step is required and must be a valid step or array of steps
- ClaudeSDKAgent resumeData must include sessionId or continue
- CursorSDKAgent resumeData must include a message.
- CursorSDKAgent resumeData.agentId must be a string when prov
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/09c539c3a8e5be98.
Report an issue: GitHub.