{"record":{"id":"e1d6b91ca2256767","repo":"mastra-ai/mastra","slug":"failed-to-time-travel-workflow-response-statust","errorCode":null,"errorMessage":"Failed to time travel workflow: ${response.statusText}","messagePattern":"Failed to time travel workflow: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"client-sdks/client-js/src/resources/run.ts","lineNumber":502,"sourceCode":"  async timeTravelStream({\n    requestContext: paramsRequestContext,\n    ...params\n  }: TimeTravelParams): Promise<globalThis.ReadableStream<StreamVNextChunkType>> {\n    const requestContext = parseClientRequestContext(paramsRequestContext);\n    const response: Response = await this.request(\n      `/workflows/${this.workflowId}/time-travel-stream?runId=${this.runId}`,\n      {\n        method: 'POST',\n        body: {\n          ...params,\n          requestContext,\n        },\n        stream: true,\n      },\n    );\n\n    if (!response.ok) {\n      throw new Error(`Failed to time travel 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","sourceCodeStart":484,"sourceCodeEnd":513,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/client-sdks/client-js/src/resources/run.ts#L484-L513","documentation":"Thrown by Run.timeTravelStream() when the time-travel streaming POST returns a non-OK HTTP status. Time travel rewinds a workflow to a prior step and streams execution; the server rejected the request so no stream is returned.","triggerScenarios":"Calling timeTravelStream() with an invalid runId, a step/run reference that does not exist, malformed time-travel payload, or server errors while rewinding (client-sdks/client-js/src/resources/run.ts:502).","commonSituations":"Time traveling to a step not in the run's history; payload schema mismatch after workflow definition changes; server rejecting rewind on completed/pruned runs.","solutions":["Verify the target step/index exists in the run's execution history before time traveling.","Confirm the time-travel payload matches the current workflow definition schema.","Check server logs for the underlying 4xx/5xx reason.","Retry transient 5xx with backoff."],"exampleFix":"// before\nawait run.timeTravelStream({ step: 'processData', inputData });\n\n// after\ntry {\n  await run.timeTravelStream({ step: 'processData', inputData });\n} catch (e) {\n  console.error('Time travel rejected:', e.message); // check step exists in run history\n}","handlingStrategy":"validation","validationCode":"const runs = await client.getWorkflowRunById(workflowId, runId);\nconst history = runs.steps ?? {};\nif (!(stepName in history)) throw new Error(`Step ${stepName} not in run history; cannot time travel`);","typeGuard":"function stepInHistory(steps: Record<string, unknown>, step: string): boolean {\n  return Object.prototype.hasOwnProperty.call(steps, step);\n}","tryCatchPattern":"try {\n  await run.timeTravelStream({ step: stepName, inputData });\n} catch (e) {\n  if (/Failed to time travel/.test(e.message)) {\n    console.error('Time travel rejected:', e.message);\n  } else throw e;\n}","preventionTips":["Verify the target step exists in the run's step history","Keep time-travel payloads in sync with workflow definition versions","Do not time travel completed/pruned runs","Retry transient 5xx with backoff"],"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"}