{"record":{"id":"91506569022627cd","repo":"mastra-ai/mastra","slug":"schedules-invalid-signal-type","errorCode":"SCHEDULES_INVALID_SIGNAL_TYPE","errorMessage":"Schedule${where}: unknown signalType \"${definition.signalType}\". Expected one of: ${SCHEDULE_SIGNAL_TYPES.join(', ')}.","messagePattern":"Schedule(.+?): unknown signalType \"(.+?)\"\\. Expected one of: (.+?)\\.","errorType":"error_code","errorClass":"MastraError","httpStatus":null,"severity":"error","filePath":"packages/core/src/schedules/define.ts","lineNumber":206,"sourceCode":"    validateCron(definition.cron, definition.timezone);\n  } catch (error) {\n    throw new MastraError(\n      {\n        id: 'SCHEDULES_INVALID_CRON',\n        domain: ErrorDomain.AGENT,\n        category: ErrorCategory.USER,\n        details: { label: label ?? '', cron: String(definition.cron) },\n        text: `Schedule${where}: ${error instanceof Error ? error.message : String(error)}`,\n      },\n      error,\n    );\n  }\n\n  // Markdown schedules never pass through TypeScript, so these enum-ish fields\n  // are only checked here. An unchecked value would reach schedule storage and\n  // surface as a confusing runtime failure on the first fire.\n  if (definition.signalType !== undefined && !SCHEDULE_SIGNAL_TYPES.includes(definition.signalType)) {\n    throw new MastraError({\n      id: 'SCHEDULES_INVALID_SIGNAL_TYPE',\n      domain: ErrorDomain.AGENT,\n      category: ErrorCategory.USER,\n      details: { label: label ?? '', signalType: String(definition.signalType) },\n      text: `Schedule${where}: unknown signalType \"${definition.signalType}\". Expected one of: ${SCHEDULE_SIGNAL_TYPES.join(', ')}.`,\n    });\n  }\n\n  if (definition.status !== undefined && !SCHEDULE_STATUSES.includes(definition.status)) {\n    throw new MastraError({\n      id: 'SCHEDULES_INVALID_STATUS',\n      domain: ErrorDomain.AGENT,\n      category: ErrorCategory.USER,\n      details: { label: label ?? '', status: String(definition.status) },\n      text: `Schedule${where}: unknown status \"${definition.status}\". Expected one of: ${SCHEDULE_STATUSES.join(', ')}.`,\n    });\n  }\n","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/mastra-ai/mastra/blob/75dd419e613fe9c39f846ffc500716141b74fda6/packages/core/src/schedules/define.ts#L188-L224","documentation":"The schedule definition's 'signalType' field was set to a value not in the SCHEDULE_SIGNAL_TYPES allowlist. Because markdown-defined schedules never pass through TypeScript checking, Mastra validates these enum-like fields at runtime in assertValidScheduleDefinition; an unchecked value would otherwise reach schedule storage and fail confusingly on the first fire. The error lists all valid signalType values.","triggerScenarios":"Calling defineSchedule({cron, prompt, signalType: '...'}) with a misspelled or unsupported signalType; a file-based/markdown schedule carrying an invalid signalType passed through resolveSchedules; upgrading/downgrading versions where the allowed set changed and an old value is no longer recognized.","commonSituations":"Typo such as 'signelType' value 'once' vs a required enum member, or copying a signalType from a different Mastra area with a different enum; hand-editing a markdown schedule with a guessed value; docs/examples from an older version using a renamed enum value.","solutions":["Set signalType to one of the values listed in the error message (the SCHEDULE_SIGNAL_TYPES allowlist).","Remove the signalType field entirely if the default is acceptable (it is optional).","Fix the spelling/casing — enum values are matched exactly, not case-insensitively.","If migrating between versions, check the changelog for renamed signalType values and update the schedule."],"exampleFix":"// before\ndefineSchedule({ cron: '0 9 * * *', prompt: 'Run', signalType: 'cron-start' });\n// after\ndefineSchedule({ cron: '0 9 * * *', prompt: 'Run' }); // or use a listed signalType value","handlingStrategy":"validation","validationCode":"import { SCHEDULE_SIGNAL_TYPES } from '@mastra/core/schedules';\nif (mySchedule.signalType !== undefined && !SCHEDULE_SIGNAL_TYPES.includes(mySchedule.signalType)) {\n  throw new Error(`signalType must be one of: ${SCHEDULE_SIGNAL_TYPES.join(', ')}`);\n}","typeGuard":"function isValidSignalType(v: unknown): v is (typeof SCHEDULE_SIGNAL_TYPES)[number] {\n  return SCHEDULE_SIGNAL_TYPES.includes(v as any);\n}","tryCatchPattern":"try {\n  const schedule = defineSchedule(def);\n} catch (e) {\n  if (e instanceof MastraError && e.id === 'SCHEDULES_INVALID_SIGNAL_TYPE') {\n    // map/normalize the value to an allowed one or drop the field\n  } else throw e;\n}","preventionTips":["Import SCHEDULE_SIGNAL_TYPES and pick values from it instead of typing strings by hand.","Omit signalType when the default is fine — the field is optional.","For markdown/file-based schedules, run resolveSchedules in CI so runtime validation catches bad enums before deploy.","Re-check enum values after Mastra version upgrades."],"tags":["schedules","enum","validation","user-error"],"backgroundTag":"invalid-enum-value","analyzedSha":"75dd419e613fe9c39f846ffc500716141b74fda6","analyzedAt":"2026-08-30T00:15:31.844Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}