{"record":{"id":"e7973e9d09630273","repo":"medusajs/medusa","slug":"action-actiontomove-could-not-be-found-in-the","errorCode":null,"errorMessage":"Action \"${actionToMove}\" could not be found in the following steps of \"${targetAction}\"","messagePattern":"Action \"(.+?)\" could not be found in the following steps of \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/orchestration/src/transaction/orchestrator-builder.ts","lineNumber":179,"sourceCode":"      runInParallel,\n      mergeNext,\n    }: {\n      runInParallel?: boolean\n      mergeNext?: boolean\n    } = {\n      runInParallel: false,\n      mergeNext: false,\n    }\n  ): OrchestratorBuilder {\n    const parentActionToMoveStep = this.findParentStepByAction(actionToMove)!\n    const parentTargetActionStep = this.findParentStepByAction(targetAction)!\n    const actionToMoveStep = this.findStepByAction(\n      actionToMove,\n      parentTargetActionStep\n    )!\n\n    if (!actionToMoveStep) {\n      throw new Error(\n        `Action \"${actionToMove}\" could not be found in the following steps of \"${targetAction}\"`\n      )\n    }\n\n    if (Array.isArray(parentActionToMoveStep.next)) {\n      const index = parentActionToMoveStep.next.findIndex(\n        (step) => step.action === actionToMove\n      )\n      if (index > -1) {\n        parentActionToMoveStep.next.splice(index, 1)\n      }\n    } else {\n      delete parentActionToMoveStep.next\n    }\n\n    if (runInParallel) {\n      if (Array.isArray(parentTargetActionStep.next)) {\n        parentTargetActionStep.next.push(actionToMoveStep)","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/orchestration/src/transaction/orchestrator-builder.ts#L161-L197","documentation":"OrchestratorBuilder.move(actionToMove, targetAction) restructures the workflow graph by relocating one action next to another. Before moving, it looks up actionToMove among targetAction's (nested) steps; if no step with that action alias exists there, it throws this error. It usually surfaces indirectly via mergeActions/moveAction/mergeNextAction compositional helpers.","triggerScenarios":"Calling .moveTo({ destinationAction }) on a step whose destination action does not (transitively) contain the moved step's alias, or composeActions/mergeActions on names that are not siblings within the target's subtree. Also happens after renaming a step alias but referencing the old name.","commonSituations":"Renaming or removing a step alias while another compose/move call still references it; typo in an action name in moveTo/mergeActions; referencing a step defined in a different (sub)workflow branch.","solutions":["Fix the reference: verify the exact alias string of both actions and that the moved action actually exists under the target's subtree","Rebuild/recompose the workflow so the actions are siblings before merging","If a step was renamed, update all moveTo/mergeActions call sites"],"exampleFix":"// before\nconst step = addToCart.appendTo(prepareCart)\nstep.moveTo({ destinationAction: \"chekout\" /* typo */ })\n\n// after\nstep.moveTo({ destinationAction: \"checkout\" })","handlingStrategy":"validation","validationCode":"const exists = (name) =>\n  JSON.stringify(builder.steps).includes(`\"action\":\"${name}\"`)\nif (!exists(destAction)) throw new Error(`Unknown action ${destAction}`)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat step aliases as constants exported next to the step definition","Lint against stringly-typed action names where possible"],"tags":["orchestration","workflow-graph","builder","compose"],"backgroundTag":"workflow-step-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}