{"record":{"id":"eb819bddee15a08c","repo":"mastra-ai/mastra","slug":"workflowdefinitions-storage-domain-is-not-availabl","errorCode":null,"errorMessage":"workflowDefinitions storage domain is not available.","messagePattern":"workflowDefinitions storage domain is not available\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mastracode/sdk/src/workflows/service.ts","lineNumber":55,"sourceCode":"  result: Promise<unknown>;\n}\n\ninterface WorkflowDefinitionsStore {\n  list: (args?: { status?: 'active' | 'archived' }) => Promise<{ definitions: StoredWorkflowRow[]; total: number }>;\n  get: (id: string) => Promise<StoredWorkflowRow | null>;\n  delete: (id: string) => Promise<void>;\n}\n\nasync function workflowDefinitionsStore(mastra: Mastra): Promise<WorkflowDefinitionsStore> {\n  const storage = mastra.getStorage();\n  if (!storage) throw new Error('Storage is not configured on the Mastra instance.');\n  // `getStore` is a generic domain accessor; workflowDefinitions is registered\n  // by mastracode. The domain shape is validated at boot; cast the resolved\n  // store to the interface we exercise.\n  const store = (await (storage as unknown as { getStore: (name: string) => Promise<unknown> }).getStore(\n    'workflowDefinitions',\n  )) as WorkflowDefinitionsStore | undefined;\n  if (!store) throw new Error('workflowDefinitions storage domain is not available.');\n  return store;\n}\n\nexport async function listWorkflows(mastra: Mastra): Promise<{ workflows: StoredWorkflowRow[]; total: number }> {\n  const store = await workflowDefinitionsStore(mastra);\n  const result = await store.list({ status: 'active' });\n  return { workflows: result.definitions, total: result.total };\n}\n\nexport async function getWorkflow(mastra: Mastra, id: string): Promise<StoredWorkflowRow | null> {\n  const store = await workflowDefinitionsStore(mastra);\n  return store.get(id);\n}\n\nexport async function deleteWorkflow(mastra: Mastra, id: string): Promise<{ ok: true; id: string }> {\n  const store = await workflowDefinitionsStore(mastra);\n  await store.delete(id);\n  // Also unregister the live in-process Workflow instance so a subsequent","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/mastracode/sdk/src/workflows/service.ts#L37-L73","documentation":"Even when storage is configured, mastracode must register the `workflowDefinitions` domain on it. workflowDefinitionsStore calls storage.getStore('workflowDefinitions') and throws this error if the domain is absent — meaning the storage backend is valid but does not expose the workflow-definitions store this service requires.","triggerScenarios":"Calling workflow service functions with a Mastra instance whose storage lacks the registered workflowDefinitions domain — e.g. a custom/partial storage implementation, an older core version without domain registration, or mastracode's domain registration skipped.","commonSituations":"Custom StorageAdapter that doesn't implement getStore for the domain; mismatched @mastra/core version where domain registration changed; boot-time registration failure silently swallowed elsewhere.","solutions":["Ensure mastracode's storage domain registration runs at boot (use the mastracode-provided storage wiring instead of a bare store)","Check package versions so @mastra/core and mastracode agree on the domains API; upgrade to matching versions","Verify with a quick probe that `await storage.getStore('workflowDefinitions')` resolves before calling service functions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const storage = mastra.getStorage();\nif (!storage) throw new Error('Storage not configured');\nconst store = await (storage as any).getStore?.('workflowDefinitions');\nif (!store) throw new Error('workflowDefinitions domain missing — use the mastracode storage wiring and matching @mastra/core version');","typeGuard":null,"tryCatchPattern":"try {\n  const { workflows } = await listWorkflows(mastra);\n} catch (e) {\n  if (String(e.message).includes('workflowDefinitions storage domain')) {\n    console.error('Check mastracode domain registration and @mastra/core version alignment.');\n  } else throw e;\n}","preventionTips":["Use the mastracode-provided storage wiring instead of a bare/custom store","Keep @mastra/core and mastracode versions aligned; upgrade together","Add a startup probe that getStore('workflowDefinitions') resolves","Avoid partial custom StorageAdapters that skip domain registration"],"tags":["storage","mastra","version-mismatch","configuration"],"backgroundTag":"missing-storage-domain","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}