windmill-labs/windmill · error
Unknown CaptureTriggerKind: ${kind}
Error message
Unknown CaptureTriggerKind: ${kind} What it means
captureTriggerKindToTriggerKind maps a CaptureTriggerKind (used by capture/install flows) to the UI TriggerKind. Any kind outside the exhaustive switch (webhook, email, default_email, http, websocket, kafka, nats, mqtt, amqp, sqs, postgres, gcp) hits the default branch and throws. It is a guard against unknown/unsupported capture trigger kinds reaching the UI.
Source
Thrown at frontend/src/lib/components/triggers.ts:91
return 'routes'
case 'websocket':
return 'websockets'
case 'kafka':
return 'kafka'
case 'nats':
return 'nats'
case 'mqtt':
return 'mqtt'
case 'amqp':
return 'amqp'
case 'sqs':
return 'sqs'
case 'postgres':
return 'postgres'
case 'gcp':
return 'gcp'
default:
throw new Error(`Unknown CaptureTriggerKind: ${kind}`)
}
}
View on GitHub (pinned to e474e8803c)
Solutions
- Add the missing kind to the switch statement in captureTriggerKindToTriggerKind (and to the CaptureTriggerKind union).
- Check the version skew: if the data comes from a newer backend, upgrade the frontend.
- Inspect the offending `kind` value in the error message and correct the capture config/project bundle.
- Update the shared enum/type definitions so the compiler flags unmapped kinds.
Example fix
// before
case 'gcp':
return 'gcp'
default:
throw new Error(`Unknown CaptureTriggerKind: ${kind}`)
// after
case 'gcp':
return 'gcp'
case 'azure':
return 'azure'
default:
console.warn(`Unknown CaptureTriggerKind: ${kind}, skipping`)
return undefined Defensive patterns
Strategy: type-guard
Validate before calling
const KNOWN: ReadonlySet<string> = new Set(['webhook','email','default_email','http','websocket','kafka','nats','mqtt','amqp','sqs','postgres','gcp'])
function isKnownCaptureKind(kind: string): boolean {
return KNOWN.has(kind)
} Type guard
function isCaptureTriggerKind(k: string): k is CaptureTriggerKind {
return ['webhook','email','default_email','http','websocket','kafka','nats','mqtt','amqp','sqs','postgres','gcp'].includes(k)
} Try / catch
try {
const triggerKind = captureTriggerKindToTriggerKind(kind)
} catch (e) {
console.warn('Skipping unknown captured trigger kind', kind)
return
} Prevention
- Keep the CaptureTriggerKind union and the switch in sync — add both when adding a kind
- Validate imported/captured data kinds before mapping
- Check for frontend/backend version skew when data comes from another deployment
- Never feed unvalidated strings from templates or storage into the mapper
When it happens
Trigger: handleClick on a captured trigger whose `kind` string is not one of the 12 supported values — e.g. a kind added to the capture payload but not to this mapper, a typo, or stale data from an older/other version.
Common situations: Importing a project bundle produced by a newer Windmill version that supports extra trigger kinds; hand-edited capture configs; backend/frontend version skew during upgrades.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Unknown TriggerKind: ${kind}
- error (from getWorkspaceMutationTargetError)
- Failed to create ${triggerConfig.label} "${requestBody.path}
- trigger kind '${trigger.kind}' not supported yet
- trigger kind '${trigger.kind}' requires Enterprise
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/06441b220e8be07d.
Report an issue: GitHub.