{"record":{"id":"12ebdb8715dca181","repo":"medusajs/medusa","slug":"action-action-could-not-be-found","errorCode":null,"errorMessage":"Action \"${action}\" could not be found","messagePattern":"Action \"(.+?)\" could not be found","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/orchestration/src/transaction/orchestrator-builder.ts","lineNumber":342,"sourceCode":"        const found = this.findStepByAction(action, subStep as InternalStep)\n        if (found) {\n          return found\n        }\n      }\n    } else if (step.next && typeof step.next === \"object\") {\n      return this.findStepByAction(action, step.next as InternalStep)\n    }\n\n    return\n  }\n\n  protected findOrThrowStepByAction(\n    action: string,\n    steps: InternalStep = this.steps\n  ): InternalStep {\n    const step = this.findStepByAction(action, steps)\n    if (!step) {\n      throw new Error(`Action \"${action}\" could not be found`)\n    }\n\n    return step\n  }\n\n  protected findParentStepByAction(\n    action: string,\n    step: InternalStep = this.steps\n  ): InternalStep | undefined {\n    if (!step.next) {\n      return\n    }\n\n    const nextSteps = Array.isArray(step.next) ? step.next : [step.next]\n    for (const nextStep of nextSteps) {\n      if (!nextStep) {\n        continue\n      }","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/orchestration/src/transaction/orchestrator-builder.ts#L324-L360","documentation":"findOrThrowStepByAction is the builder's internal lookup used by step(), appendTo(), and actionStep(). When the requested action alias is not present in the (sub)graph being built, it throws this error. It means you referenced a step name that does not exist in the current workflow definition.","triggerScenarios":"Calling builder.step('name') / appendTo('name') / actionStep with an alias never added via addOrMergeStep/branch, or one that exists only in a different workflow or a nested subflow you did not include. Also triggered by typos or after renaming aliases.","commonSituations":"Renaming a step without updating references; referencing steps of a composed workflow from the wrong builder instance; dynamic alias construction producing wrong strings.","solutions":["Check the workflow definition for the exact alias spelling (case-sensitive)","Ensure the referenced step was added to the same builder/subtree (e.g. via appendTo/branch) before referencing it","Log/inspect builder.steps (JSON.stringify the flow) to see the actual action names"],"exampleFix":"// before\nconst s = builder.step('createOrdder') // typo\n\n// after\nconst s = builder.step('createOrder')","handlingStrategy":"validation","validationCode":"const hasAction = (steps, name) =>\n  steps.some((s) => s.action === name || (s.next && hasAction(s.next, name)))\nif (!hasAction(builder.steps, action)) {\n  throw new Error(`Action ${action} not in graph`)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep step alias constants in one module and import them everywhere","Dump the built flow (console.dir) when composition fails to see real names"],"tags":["orchestration","workflow-graph","builder","step-not-found"],"backgroundTag":"workflow-step-not-found","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}