{"record":{"id":"a9abe135fbde5ac0","repo":"mastra-ai/mastra","slug":"failed-to-stream-vnext-workflow-response-status","errorCode":null,"errorMessage":"Failed to stream vNext workflow: ${response.statusText}","messagePattern":"Failed to stream vNext workflow: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"client-sdks/client-js/src/resources/run.ts","lineNumber":398,"sourceCode":"    const requestContext = parseClientRequestContext(params.requestContext);\n    const response: Response = await this.request(\n      `/workflows/${this.workflowId}/resume-stream?${searchParams.toString()}`,\n      {\n        method: 'POST',\n        body: {\n          step: params.step,\n          resumeData: params.resumeData,\n          requestContext,\n          tracingOptions: params.tracingOptions,\n          perStep: params.perStep,\n          forEachIndex: params.forEachIndex,\n        },\n        stream: true,\n      },\n    );\n\n    if (!response.ok) {\n      throw new Error(`Failed to stream vNext workflow: ${response.statusText}`);\n    }\n\n    if (!response.body) {\n      throw new Error('Response body is null');\n    }\n\n    // Pipe the response body through the transform stream\n    return response.body.pipeThrough(this.createChunkTransformStream());\n  }\n\n  /**\n   * Restarts an active workflow run synchronously without waiting for the workflow to complete\n   * @param params - Object containing the requestContext\n   * @returns Promise containing success message\n   */\n  restart(params: {\n    requestContext?: RequestContext | Record<string, any>;\n    tracingOptions?: TracingOptions;","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/client-sdks/client-js/src/resources/run.ts#L380-L416","documentation":"Thrown by Run.resumeStream() when the vNext workflow resume-stream POST returns a non-OK HTTP status. The resume request was rejected by the server, so no event stream can be established.","triggerScenarios":"Calling resumeStream() with a resume payload on a run that is not suspended, already finished, or with an invalid run/workflow ID; server-side errors during resume (client-sdks/client-js/src/resources/run.ts:398).","commonSituations":"Resuming after the suspend point no longer exists; double-resume attempts; stale run references after server redeploy.","solutions":["Check run.status() before resuming — only suspended runs can be resumed via stream.","Validate the runId/workflowId and resume data schema match the workflow's suspend/resume contract.","Inspect server logs for the HTTP error detail.","Guard against double-resume with application-level state."],"exampleFix":"// before\nawait run.resumeStream({ resumeData: { approved: true } });\n\n// after\nconst status = await run.status();\nif (status.status === 'suspended') {\n  await run.resumeStream({ resumeData: { approved: true } });\n}","handlingStrategy":"validation","validationCode":"const status = await run.status();\nif (status.status !== 'suspended') throw new Error(`Cannot resumeStream: run is ${status.status}, expected suspended`);","typeGuard":"function canResume(s: { status: string }): s is { status: 'suspended' } { return s.status === 'suspended'; }","tryCatchPattern":"try {\n  await run.resumeStream({ resumeData });\n} catch (e) {\n  if (/Failed to stream vNext workflow/.test(e.message)) {\n    console.error('Resume rejected:', e.message);\n  } else throw e;\n}","preventionTips":["Check run.status() === 'suspended' before resuming","Add app-level guard against double resume","Validate resumeData against the workflow suspend schema","Re-create run references after server redeploys"],"tags":["network","streaming","workflow"],"backgroundTag":"http-error-response","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}