{"record":{"id":"d45e1f5480be59fa","repo":"mastra-ai/mastra","slug":"inprocessstrategy-could-not-resolve-step-param","errorCode":null,"errorMessage":"InProcessStrategy: could not resolve step \"${params.stepId}\" at executionPath [${params.executionPath.join(',')}] in workflow \"${params.workflowId}\"","messagePattern":"InProcessStrategy: could not resolve step \"(.+?)\" at executionPath \\[(.+?)\\] in workflow \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/worker/strategies/in-process-strategy.ts","lineNumber":34,"sourceCode":"    this.#mastra = mastra;\n  }\n\n  __registerMastra(mastra: Mastra): void {\n    this.#mastra = mastra;\n  }\n\n  async executeStep(params: StepExecutionParams): Promise<StepResult<any, any, any, any>> {\n    if (!this.#mastra) {\n      throw new Error('InProcessStrategy requires Mastra instance. Call __registerMastra() first.');\n    }\n\n    // Use getWorkflowById — events carry the workflow's `id` property\n    // (e.g. \"scheduled-workflow\"), not the config key (\"scheduledWorkflow\").\n    const workflow = this.#mastra.getWorkflowById(params.workflowId);\n    const entry = getStepEntry(workflow, params.executionPath);\n\n    if (!entry) {\n      throw new Error(\n        `InProcessStrategy: could not resolve step \"${params.stepId}\" at executionPath [${params.executionPath.join(',')}] in workflow \"${params.workflowId}\"`,\n      );\n    }\n\n    const rc = new RequestContext<unknown>(Object.entries(params.requestContext ?? {}));\n\n    let abortController: AbortController | undefined;\n    if (params.abortSignal) {\n      abortController = new AbortController();\n      if (params.abortSignal.aborted) {\n        abortController.abort(params.abortSignal.reason);\n      } else {\n        params.abortSignal.addEventListener(\n          'abort',\n          () => {\n            abortController!.abort(params.abortSignal!.reason);\n          },\n          { once: true },","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/worker/strategies/in-process-strategy.ts#L16-L52","documentation":"InProcessStrategy executes workflow steps inside the same process as Mastra. Before executing, it resolves the workflow by ID via mastra.getWorkflowById() and walks the executionPath to find the step's run entry. This error means that lookup returned nothing: either the workflow ID doesn't exist or the executionPath/stepId doesn't match a step registered in the workflow.","triggerScenarios":"Calling executeStep with a workflowId that was never registered (or registered under a different config key), a stepId that is not part of the workflow's steps, or an executionPath array that doesn't correspond to an active/valid nested run path (e.g. referencing a nested step after the run finished or before it started).","commonSituations":"Using the Mastra config key ('scheduledWorkflow') instead of the workflow instance's id ('scheduled-workflow'); renaming or removing a step without updating the caller; passing a stale executionPath captured from an earlier run; typos in step IDs.","solutions":["Verify the workflowId matches the workflow instance's `id` property, not the Mastra config key — use getWorkflowById semantics","Print mastra.getSteps()/workflow definition and confirm the stepId exists in that workflow","Check the executionPath: it must point to a live nested step run; re-fetch the run's executionPath via workflow runs API instead of reusing a stale one","If the workflow lives in another process/service, switch to the remote/HTTP step execution strategy instead of InProcessStrategy"],"exampleFix":"// before\nawait strategy.executeStep({ workflowId: 'scheduledWorkflow', stepId: 'sendEmail', executionPath: ['0'] });\n// after\nconst wf = mastra.getWorkflowById('scheduled-workflow'); // use the workflow's id, not the config key\nawait strategy.executeStep({ workflowId: wf.id, stepId: 'sendEmail', executionPath: currentRun.executionPath });","handlingStrategy":"validation","validationCode":"const wf = mastra.getWorkflowById(workflowId);\nif (!wf) throw new Error(`Unknown workflow: ${workflowId}`);\nconst step = wf.getStep(stepId);\nif (!step) throw new Error(`Workflow ${workflowId} has no step ${stepId}`);","typeGuard":"function isRegisteredWorkflow(mastra, id) { return typeof mastra.getWorkflowById(id) !== 'undefined'; }","tryCatchPattern":"try {\n  await strategy.executeStep(params);\n} catch (e) {\n  if (String(e.message).startsWith('InProcessStrategy: could not resolve step')) {\n    logger.error('step/workflow resolution failed', { workflowId: params.workflowId, stepId: params.stepId, executionPath: params.executionPath });\n  } else throw e;\n}","preventionTips":["Always use the workflow instance's `id`, never the Mastra config key","Validate stepId against the workflow definition before executing","Fetch executionPath from the live run instead of caching it","Add a startup check that all callable workflows resolve via getWorkflowById"],"tags":["workflow","configuration","step-resolution"],"backgroundTag":"workflow-step-not-found","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}