{"record":{"id":"20272548432489eb","repo":"medusajs/medusa","slug":"workflow-registration-requires-id-received-jso","errorCode":null,"errorMessage":"Workflow registration requires id. Received: ${JSON.stringify(data)}","messagePattern":"Workflow registration requires id\\. Received: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/utils/src/dev-server/handlers/workflow-handler.ts","lineNumber":20,"sourceCode":"  ResourceEntry,\n  ResourceTypeHandler,\n  WorkflowResourceData,\n} from \"../types\"\n\nexport class WorkflowHandler\n  implements ResourceTypeHandler<WorkflowResourceData>\n{\n  readonly type = \"workflow\"\n\n  validate(data: WorkflowResourceData): void {\n    if (!data.sourcePath) {\n      throw new Error(\n        `Workflow registration requires sourcePath. Received: ${JSON.stringify(\n          data\n        )}`\n      )\n    }\n\n    if (!data.id) {\n      throw new Error(\n        `Workflow registration requires id. Received: ${JSON.stringify(data)}`\n      )\n    }\n  }\n\n  resolveSourcePath(data: WorkflowResourceData): string {\n    return data.sourcePath\n  }\n\n  createEntry(data: WorkflowResourceData): ResourceEntry {\n    return {\n      id: data.id,\n      workflowId: data.id,\n    }\n  }\n","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/medusajs/medusa/blob/5e06e544a296b9033f20f71f11c559f81a0e5739/packages/core/utils/src/dev-server/handlers/workflow-handler.ts#L2-L38","documentation":"Dev-server validation error from WorkflowHandler.validate: a workflow resource was registered without an `id`. The id (the workflow name passed to createWorkflow) is the key under which the dev server tracks the workflow and its steps for hot-reload; registration without it is rejected.","triggerScenarios":"Registering a workflow with only { type: 'workflow', sourcePath } and no id; loaders deriving the id from a variable that is undefined; registering an anonymous/dynamically-created workflow that never received a name.","commonSituations":"Custom loaders auto-registering workflow files; refactors renaming workflow ids while registration reads a stale property; workflows created via factories where the generated id is not passed along.","solutions":["Include the workflow's id — the same unique string given to createWorkflow — in the registration data.","Assert the id is a non-empty string before registering.","Keep the id consistent with the workflowId referenced by any step registrations so the inverse registry links them."],"exampleFix":"// before\nregisterDevServerResource({ type: 'workflow', sourcePath })\n\n// after\nregisterDevServerResource({ type: 'workflow', id: 'cart-workflow', sourcePath })","handlingStrategy":"validation","validationCode":"if (!data.id) throw new Error(`Workflow registration missing id: ${JSON.stringify(data)}`)","typeGuard":"function isWorkflowResourceData(d: unknown): d is WorkflowResourceData {\n  return typeof (d as any)?.id === 'string' && typeof (d as any)?.sourcePath === 'string'\n}","tryCatchPattern":null,"preventionTips":["Pass the exact createWorkflow id string into registration data.","Keep workflow ids in constants shared by workflow and step registrations.","Assert non-empty id before calling the dev server."],"tags":["dev-server","workflow","id","registration","validation","hot-reload"],"backgroundTag":"missing-required-field-registration","analyzedSha":"5e06e544a296b9033f20f71f11c559f81a0e5739","analyzedAt":"2026-08-27T07:24:39.599Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}