{"record":{"id":"d3e7b3431118a8be","repo":"mastra-ai/mastra","slug":"schedules-no-schedules-storage","errorCode":"SCHEDULES_NO_SCHEDULES_STORAGE","errorMessage":"Schedules require a storage adapter that implements the schedules domain.","messagePattern":"Schedules require a storage adapter that implements the schedules domain\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/schedules/schedules.ts","lineNumber":236,"sourceCode":" * agent (via signal or `agent.generate`), `type: 'workflow'` rows start a\n * workflow run. This class is a typed projection over `SchedulesStorage`\n * that knows how to build targets and surface flat\n * {@link AgentSchedule} / {@link WorkflowSchedule} views.\n *\n * Use via `mastra.schedules` (the canonical CRUD surface).\n */\nexport class Schedules {\n  #mastra: Mastra;\n\n  constructor(mastra: Mastra) {\n    this.#mastra = mastra;\n  }\n\n  async #getStore() {\n    const storage = this.#mastra.getStorage();\n    const store = await storage?.getStore('schedules');\n    if (!store) {\n      throw new MastraError({\n        id: 'SCHEDULES_NO_SCHEDULES_STORAGE',\n        domain: ErrorDomain.AGENT,\n        category: ErrorCategory.USER,\n        text: 'Schedules require a storage adapter that implements the schedules domain.',\n      });\n    }\n    return store;\n  }\n\n  /**\n   * Resolve a caller-supplied id to a stored row. An id is first looked up\n   * verbatim (covering `agent_`, `schedule_`, `wf_`, and legacy `hb_` ids);\n   * when that misses, a bare caller id is canonicalized to `agent_<slug>` to\n   * match what agent-schedule `create` persisted.\n   */\n  async #load(id: string): Promise<Schedule | null> {\n    const store = await this.#getStore();\n    const trimmed = id.trim();","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/schedules/schedules.ts#L218-L254","documentation":"The `Schedules` service (`#getStore` in packages/core/src/schedules/schedules.ts:236) requires a storage adapter that implements the schedules domain. It fetches the Mastra storage instance and asks it for the `schedules` store; if no storage is configured or the adapter has no schedules domain, `SCHEDULES_NO_SCHEDULES_STORAGE` is thrown because schedule rows cannot be persisted.","triggerScenarios":"Any schedules API call (`create`, `list`, `get`, `update`, `delete`, `pause`, `resume`) when `Mastra` was constructed without `storage`, or with a storage adapter whose `getStore('schedules')` returns nothing (adapter does not implement the schedules domain).","commonSituations":"Omitting the `storage` option in `new Mastra({...})` in dev; using an older or minimal storage adapter (e.g. libsql/in-memory variant) that predates or omits the schedules domain; upgrading Mastra and calling the new schedules API against a pre-existing storage config; unit tests instantiating Mastra without storage.","solutions":["Configure a storage adapter that implements the schedules domain, e.g. `new Mastra({ storage: new LibSQLStore({ url: 'file:./mastra.db' }) })` (or your preferred supported store), and rebuild.","Upgrade the storage package (`@mastra/libsql`, `@mastra/pg`, etc.) to a version that implements the schedules domain.","Verify with `await storage.getStore('schedules')` that the store resolves before using schedules."],"exampleFix":"// before\nexport const mastra = new Mastra({ agents }); // no storage\n\n// after\nimport { LibSQLStore } from '@mastra/libsql';\nexport const mastra = new Mastra({\n  agents,\n  storage: new LibSQLStore({ url: 'file:./mastra.db' }),\n});","handlingStrategy":"validation","validationCode":"async function assertSchedulesStorage(mastra) {\n  const storage = mastra.getStorage();\n  if (!storage) throw new Error('Mastra instance has no storage configured');\n  const store = await storage.getStore('schedules');\n  if (!store) throw new Error('Storage adapter does not implement the schedules domain');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await schedules.create(input);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'SCHEDULES_NO_SCHEDULES_STORAGE') {\n    console.error('Configure a storage adapter that implements the schedules domain');\n  } else throw e;\n}","preventionTips":["Always configure a storage adapter in `new Mastra({ storage: ... })` when using schedules.","Keep storage packages (@mastra/libsql, @mastra/pg, ...) on versions implementing the schedules domain.","Add a startup smoke test calling `storage.getStore('schedules')`."],"tags":["schedules","storage","configuration","missing-dependency"],"backgroundTag":"missing-storage-adapter","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}