{"record":{"id":"a268dfbad92a11a7","repo":"windmill-labs/windmill","slug":"unknown-triggerkind-kind","errorCode":null,"errorMessage":"Unknown TriggerKind: ${kind}","messagePattern":"Unknown TriggerKind: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/triggers/utils.ts","lineNumber":344,"sourceCode":"\t\t\treturn 'postgres'\n\t\tcase 'kafka':\n\t\t\treturn 'kafka'\n\t\tcase 'nats':\n\t\t\treturn 'nats'\n\t\tcase 'mqtt':\n\t\t\treturn 'mqtt'\n\t\tcase 'amqp':\n\t\t\treturn 'amqp'\n\t\tcase 'sqs':\n\t\t\treturn 'sqs'\n\t\tcase 'gcp':\n\t\t\treturn 'gcp'\n\t\tcase 'azure':\n\t\t\treturn 'azure'\n\t\tcase 'scheduledPoll':\n\t\t\treturn 'poll'\n\t\tdefault:\n\t\t\tthrow new Error(`Unknown TriggerKind: ${kind}`)\n\t}\n}\n\nexport async function deployTriggers(\n\ttriggersToDeploy: Trigger[],\n\tworkspaceId: string | undefined,\n\tisAdmin: boolean,\n\tusedTriggerKinds: Writable<string[]>,\n\tinitialPath?: string,\n\tisNew?: boolean\n) {\n\tif (!workspaceId) return\n\n\tif (isNew && initialPath) {\n\t\ttriggersToDeploy.forEach((trigger) => {\n\t\t\ttrigger.draftConfig = {\n\t\t\t\t...trigger.draftConfig,\n\t\t\t\tscript_path: initialPath","sourceCodeStart":326,"sourceCodeEnd":362,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/triggers/utils.ts#L326-L362","documentation":"triggerKindToTriggerType translates the frontend TriggerKind into the backend TriggerType ('webhooks'→'webhook', etc.). Unknown kinds hit the default branch and throw. It guards deploy/processing code against trigger kinds that have no backend type mapping yet.","triggerScenarios":"Calling triggerKindToTriggerType (directly or via the `triggerType` derived/consumer) with a TriggerKind not present in the switch — e.g. a newly added kind missing its mapping, or legacy/stale data containing a removed kind.","commonSituations":"Frontend/backend version skew after adding a new trigger integration; a kind added to the TriggerKind union but not to this migration mapper; corrupted/stale workspace trigger settings.","solutions":["Add a case for the missing kind in triggerKindToTriggerType, mapping it to the correct TriggerType.","Sync frontend and backend versions if the kind was introduced in a newer release.","Log the full kind value from the message and check TRIGGER_KINDS/enum definitions for the intended mapping.","Migrate stale persisted data that references removed kinds."],"exampleFix":"// before\ncase 'scheduledPoll':\n  return 'poll'\ndefault:\n  throw new Error(`Unknown TriggerKind: ${kind}`)\n// after\ncase 'scheduledPoll':\n  return 'poll'\ncase 'azure':\n  return 'azure'\ndefault:\n  console.warn(`Unknown TriggerKind: ${kind}`)\n  return undefined","handlingStrategy":"type-guard","validationCode":"const MAPPINGS: Record<string, TriggerType> = { webhooks:'webhook', emails:'email', default_emails:'default_email', schedules:'schedule', routes:'http', websockets:'websocket', postgres:'postgres', kafka:'kafka', nats:'nats', mqtt:'mqtt', amqp:'amqp', sqs:'sqs', gcp:'gcp', azure:'azure', scheduledPoll:'poll' }\nfunction isMappedKind(kind: string): boolean {\n  return kind in MAPPINGS\n}","typeGuard":"function isTriggerKind(k: string): k is TriggerKind {\n  return k in MAPPINGS\n}","tryCatchPattern":"try {\n  const type = triggerKindToTriggerType(kind)\n} catch (e) {\n  console.warn(`No TriggerType mapping for ${kind}; skipping`)\n  return undefined\n}","preventionTips":["Add the mapping case the moment a new TriggerKind is introduced","Use a Record<TriggerKind, TriggerType> object to get exhaustiveness checking at compile time","Check version skew when kinds come from persisted settings or another deployment","Test trigger deploy paths after adding any trigger integration"],"tags":["triggers","enum-mapping","version-skew"],"backgroundTag":"invalid-enum-value","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}