{"record":{"id":"110ba5b941967887","repo":"medusajs/medusa","slug":"not-found","errorCode":"not_found","errorMessage":"Store not found","messagePattern":"Store not found","errorType":"http","errorClass":"MedusaError","httpStatus":404,"severity":"error","filePath":"packages/core/core-flows/src/cart/steps/find-one-or-any-region.ts","lineNumber":88,"sourceCode":"/**\n * This step retrieves a region either by the provided ID or the first region in the first store.\n */\nexport const findOneOrAnyRegionStep = createStep(\n  findOneOrAnyRegionStepId,\n  async (data: FindOneOrAnyRegionStepInput, { container }) => {\n    if (data.regionId) {\n      try {\n        const region = await fetchRegionById(data.regionId, container)\n        return new StepResponse(region)\n      } catch (error) {\n        return new StepResponse(null)\n      }\n    }\n\n    const store = await fetchDefaultStore(container)\n\n    if (!store) {\n      throw new MedusaError(MedusaError.Types.NOT_FOUND, \"Store not found\")\n    }\n\n    const region = await fetchDefaultRegion(store.default_region_id!, container)\n\n    if (!region) {\n      return new StepResponse(null)\n    }\n\n    return new StepResponse(region)\n  }\n)\n","sourceCodeStart":70,"sourceCodeEnd":100,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/core-flows/src/cart/steps/find-one-or-any-region.ts#L70-L100","documentation":"The Redis engine's getRunningTransaction throws a plain Error 'TransactionId ID is required' when transactionId is falsy — it cannot inspect or resume a transaction without its id (note the doubled 'Id ID' wording in the message).","triggerScenarios":"Calling getRunningTransaction(workflowId, undefined | '') — e.g. inspecting a waiting workflow without the id captured at start.","commonSituations":"The 'auto-<ULID>' generated transactionId was never persisted; resuming from webhook data missing the transaction reference.","solutions":["Capture and persist the transactionId when the run starts (pass your own via context.transactionId to control it)","Validate before calling","Look up the transactionId from your run records first"],"exampleFix":"// before\nawait engine.getRunningTransaction('orders', undefined)\n// after\nawait engine.getRunningTransaction('orders', await loadTxIdForOrder(orderId))","handlingStrategy":"validation","validationCode":"if (!transactionId) throw new Error('transactionId is required')\nawait engine.getRunningTransaction(workflowId, transactionId)","typeGuard":"const isTxId = (v: unknown): v is string => typeof v === 'string' && v.length > 0","tryCatchPattern":"catch (e) { if (e.message === 'TransactionId ID is required') return badRequest(); throw e }","preventionTips":["Pass explicit transactionId at run() so later lookups are deterministic","Store transaction ids keyed by business entity"],"tags":["workflow-engine","redis","validation"],"backgroundTag":"missing-required-argument","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}