{"record":{"id":"53704db724a871a7","repo":"mastra-ai/mastra","slug":"time-travel-target-step-not-found-in-execution-gra","errorCode":null,"errorMessage":"Time travel target step not found in execution graph: '${steps?.join('.')}'. Verify the step id/path.","messagePattern":"Time travel target step not found in execution graph: '(.+?)'\\. Verify the step id/path\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/workflows/utils.ts","lineNumber":558,"sourceCode":"        (!snapshotContext[stepId] || (snapshotContext[stepId] && snapshotContext[stepId].status !== 'suspended'))\n      ) {\n        // if the step is after the timeTravelled step in the graph\n        // and it doesn't exist in the snapshot,\n        // OR it exists in snapshot and is not suspended,\n        // we don't need to set stepResult for it\n        // if perStep is true, and the step is a parallel step,\n        // we want to construct result for only the timetraveled step and any step context is passed for\n        result = undefined;\n      }\n      if (result) {\n        const formattedResult = removeUndefinedValues(result);\n        stepResults[stepId] = formattedResult as any;\n      }\n    });\n  }\n\n  if (!executionPath.length) {\n    throw new Error(\n      `Time travel target step not found in execution graph: '${steps?.join('.')}'. Verify the step id/path.`,\n    );\n  }\n\n  const timeTravelData: TimeTravelExecutionParams = {\n    inputData,\n    executionPath,\n    steps,\n    stepResults,\n    nestedStepResults: nestedStepsContext as any,\n    state: initialState ?? snapshot.value ?? {},\n    resumeData,\n    stepExecutionPath: snapshot?.stepExecutionPath,\n  };\n\n  return timeTravelData;\n};\n","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/workflows/utils.ts#L540-L576","documentation":"createTimeTravelExecutionParams throws when the requested steps path resolves to an empty execution path in the graph — i.e. the target step was not found. It asks the caller to verify the step id or nested path.","triggerScenarios":"Calling createTimeTravelExecutionParams (or the timeTravel API) with steps such as ['stepA','subStepB'] where any segment does not resolve in the execution graph — misspelled step id, nested path segments joined with '.' that don't match the graph, or a step id from a different workflow version.","commonSituations":"Typo in step id; using the nested path of a sub-workflow/mapped step incorrectly; step ids changed after refactoring; targeting steps in a different workflow than the run belongs to.","solutions":["Verify each segment of the steps path matches actual step ids in the workflow definition.","Log or list available step ids for the run and pick the correct one.","Use a simple top-level step id first, then add nested path segments once confirmed.","If ids changed in a refactor, update callers/tests that reference the old ids."],"exampleFix":"// before\ntimeTravel(runId, ['step-a', 'nested.step-b']);\n// after\ntimeTravel(runId, ['stepA', 'stepB']); // ids matching the workflow definition","handlingStrategy":"validation","validationCode":"function assertPathExists(steps: string[], workflowStepIds: string[]) {\n  if (!steps.length || !steps.every(s => workflowStepIds.includes(s))) {\n    throw new Error(`Unknown time travel path: ${steps.join('.')}; valid: ${workflowStepIds.join(', ')}`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  await workflow.timeTravel(runId, steps);\n} catch (e) {\n  if ((e as Error).message.includes('target step not found in execution graph')) {\n    console.error(`Check path '${steps.join('.')}' against the workflow definition`);\n  } else throw e;\n}","preventionTips":["Reference step ids from a shared constants file instead of string literals","Confirm step ids after any refactor of the workflow definition","Test time-travel paths in CI against the live workflow definition","Avoid free-form nested '.' paths unless the nested step ids are verified"],"tags":["workflows","time-travel","execution-graph","invalid-path"],"backgroundTag":"time-travel-step-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}