{"record":{"id":"4e632218ef725922","repo":"medusajs/medusa","slug":"config-file-must-be-of-type-json-or-yaml-c","errorCode":null,"errorMessage":"--config file must be of type .json or .yaml - ${configFileCustom}","messagePattern":"--config file must be of type \\.json or \\.yaml - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/oas/medusa-oas-cli/src/command-docs.ts","lineNumber":120,"sourceCode":"  const shouldSplit = !!cliParams.split\n  const shouldPreview = !!cliParams.preview\n  const shouldBuildHTML = !!cliParams.html\n  const dryRun = !!cliParams.dryRun\n  const srcFile = path.resolve(cliParams.srcFile)\n  const outDir = path.resolve(cliParams.outDir)\n  const archiveOutFile = cliParams.archiveOutFile\n    ? path.resolve(cliParams.archiveOutFile)\n    : undefined\n\n  const configFileCustom = cliParams.config\n    ? path.resolve(cliParams.config)\n    : undefined\n  if (configFileCustom) {\n    if (!(await isFile(configFileCustom))) {\n      throw new Error(`--config must be a file - ${configFileCustom}`)\n    }\n    if (![\".json\", \".yaml\"].includes(path.extname(configFileCustom))) {\n      throw new Error(\n        `--config file must be of type .json or .yaml - ${configFileCustom}`\n      )\n    }\n  }\n\n  /**\n   * Command execution\n   */\n  console.log(`🟣 Generating API documentation`)\n\n  const tmpDir = await getTmpDirectory()\n  const configTmpFile = path.resolve(tmpDir, \"redocly-config.yaml\")\n  /** matches naming convention from `redocly split` */\n  const finalOASFile = cliParams.mainFileName\n\n  await createTmpConfig(configFileDefault, configTmpFile)\n  if (configFileCustom) {\n    console.log(","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/cli/oas/medusa-oas-cli/src/command-docs.ts#L102-L138","documentation":"The Redis engine's run() resolves the workflow definition from the global MedusaWorkflow registry. If getWorkflow(workflowId) returns undefined, the id was never registered in this process, and the run is rejected with NOT_FOUND.","triggerScenarios":"engine.run('some-id', ...) where 'some-id' is not a workflow registered via createWorkflow in the current process — typo, unimported workflow module, or engine running in a separate process from the app.","commonSituations":"Microservice setups where the engine worker doesn't import the workflow modules; renamed workflow ids persisted in queues; lazy-loaded plugins whose workflow registration hasn't executed yet.","solutions":["Ensure the workflow module is imported before run() in the same process","Use the id constant exported by the workflow definition instead of a hardcoded string","If running a dedicated engine process, register workflows there too"],"exampleFix":"// before\nawait engine.run('crete-order', input)\n// after\nimport { createOrderWorkflow } from '@store/workflows'\nawait engine.run(createOrderWorkflow, input)","handlingStrategy":"type-guard","validationCode":"const workflowId = typeof wf === 'string' ? wf : wf.getName()\nif (!MedusaWorkflow.getWorkflow(workflowId)) throw new Error(`workflow ${workflowId} not registered in this process`)\nawait engine.run(workflowId, input)","typeGuard":"const isRegistered = (id: string) => Boolean(MedusaWorkflow.getWorkflow(id))","tryCatchPattern":"catch (e) { if (e.type === 'not_found' && e.message.includes('not found')) return alertUnregistered(id); throw e }","preventionTips":["Import workflow modules in the entrypoint of the process that runs them","Use exported workflow objects instead of raw id strings"],"tags":["workflow-engine","redis","workflow-registry","not-found"],"backgroundTag":"workflow-not-registered","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}