windmill-labs/windmill · error · Error

Unexpected trigger kind got: ${kind}

Error message

Unexpected trigger kind got: ${kind}

What it means

getTriggersDeployData in frontend/src/lib/utils_deployable.ts (line 352) resolves, for a given TriggerKind, the trigger's current data plus the createFn/updateFn service methods used to deploy it. It handles only the 12 deployable trigger kinds; any other TriggerKind value (e.g. UI-only kinds like 'webhooks', 'cli', 'scheduledPoll', 'nextcloud', 'google', 'github', 'default_emails') reaches the terminal throw. This is an internal exhaustiveness guard for the workspace deploy flow.

Source

Thrown at frontend/src/lib/utils_deployable.ts:352

		}
	} else if (kind === 'schedules') {
		const schedulesTrigger = await ScheduleService.getSchedule({
			workspace: workspace!,
			path: path
		})
		return {
			data: {
				...schedulesTrigger,
				// permissioned_as is only set on create, not update
				permissioned_as: onBehalfOf,
				preserve_permissioned_as: preservePermissionedAs
			},
			createFn: ScheduleService.createSchedule,
			updateFn: ScheduleService.updateSchedule
		}
	}

	throw new Error(`Unexpected trigger kind got: ${kind}`)
}

/**
 * Runtime fields stripped from the trigger/schedule diff so the drawer mirrors
 * the backend's `compare_two_trigger_or_schedule` semantics — same set as
 * `TRIGGER_COMPARE_IGNORE` and `stripTriggerOrScheduleRuntimeFields` in the
 * shared deploy module.
 */
export const TRIGGER_RUNTIME_IGNORE = new Set([
	'workspace_id',
	'edited_by',
	'edited_at',
	'email',
	'error',
	'enabled',
	'mode',
	'server_id',
	'last_server_ping',

View on GitHub (pinned to e474e8803c)

Solutions

  1. Log/inspect the `kind` value in the error and confirm it is one of the 12 supported trigger kinds; correct the caller if it passes e.g. 'webhooks' or 'schedule' (should be 'schedules').
  2. If the item genuinely is not a deployable trigger kind, filter it out of the deploy loop before calling getTriggersDeployData.
  3. If you introduced a new trigger kind, add an `else if` branch that fetches the trigger via its Service.get* and returns its Service.create*/update* pair.
  4. Ensure the kind string is normalized from backend item types ('http_trigger' → 'routes', etc.) before dispatch.

Example fix

// before
const { data, createFn, updateFn } = await getTriggersDeployData('schedule', path, workspace)
// after
const { data, createFn, updateFn } = await getTriggersDeployData('schedules', path, workspace)
Defensive patterns

Strategy: validation

Validate before calling

const DEPLOY_KINDS = ['sqs','kafka','mqtt','amqp','nats','gcp','postgres','websockets','routes','azure','emails','schedules'] as const
if (!(DEPLOY_KINDS as readonly string[]).includes(kind)) {
  console.warn(`Skipping deploy data for non-deployable trigger kind ${kind}`)
  return
}
const deployData = await getTriggersDeployData(kind, path, workspace)

Type guard

const DEPLOY_KINDS = ['sqs','kafka','mqtt','amqp','nats','gcp','postgres','websockets','routes','azure','emails','schedules'] as const
type DeployableTriggerKind = (typeof DEPLOY_KINDS)[number]
function isDeployableTriggerKind(k: string): k is DeployableTriggerKind {
  return (DEPLOY_KINDS as readonly string[]).includes(k)
}

Try / catch

try {
  const { data, createFn, updateFn } = await getTriggersDeployData(kind, path, workspace)
} catch (e) {
  if (String(e?.message).startsWith('Unexpected trigger kind got:')) {
    // skip this item in the deploy loop and report it at the end
  } else throw e
}

Prevention

When it happens

Trigger: Calling getTriggersDeployData(kind, path, workspace) during deployment of a workspace item whose kind is not one of sqs, kafka, mqtt, amqp, nats, gcp, postgres, websockets, routes, azure, emails, schedules — typically 'webhooks' or 'cli' coming from a trigger list, or a misspelled kind string.

Common situations: Deploying a workspace containing non-capture trigger types whose kind leaks into the trigger-deploy loop; a new trigger kind added to TriggerKind but not to this dispatcher; a kind mapping change between the backend compare API naming ('schedules' vs 'schedule') and the frontend.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/95e001f49af650b1. Report an issue: GitHub.