windmill-labs/windmill · error

trigger_kind is required when deploying a trigger.

Error message

trigger_kind is required when deploying a trigger.

What it means

Validation error thrown at the top of the chat's deployDraft tool. Trigger items exist in several kinds (webhook, schedule-like native triggers, etc.), and getGlobalDraft needs the trigger_kind to locate the right draft. If the deploying tool call has type 'trigger' but no trigger_kind argument, the tool refuses before doing any work. It is a strict argument-contract error for the AI agent's tool schema.

Source

Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:7259

		type: WorkspaceItemType
		path: string
		trigger_kind?: TriggerKind
		deployment_message?: string
		force?: boolean
	},
	ctx: WriteDraftCtx
): Promise<string> {
	const { workspace, toolId, toolCallbacks, sessionId } = ctx
	const {
		type,
		path,
		trigger_kind: triggerKind,
		deployment_message: deploymentMessage,
		force
	} = args

	if (type === 'trigger' && !triggerKind) {
		throw new Error('trigger_kind is required when deploying a trigger.')
	}

	const draft = await getGlobalDraft(workspace, type, path, triggerKind)
	if (!draft) {
		throw new Error(`No draft found for ${type} "${path}".`)
	}
	if (draft.value === undefined) {
		throw new Error(`Draft ${type} "${path}" has no value to deploy.`)
	}

	toolCallbacks.setToolStatus(toolId, {
		content: `Deploying ${type} "${path}"...`
	})

	let actions: ToolDisplayAction[] | undefined
	// Where the deploy actually lands — the app branch can resolve a different
	// target from the draft's own path fields; the mask rename below must track it.
	let deployedPath = path

View on GitHub (pinned to e474e8803c)

Solutions

  1. Retry the deploy tool call including trigger_kind (e.g. 'webhook', the kind the trigger was created with).
  2. If you are driving the tool programmatically, add the trigger_kind field to the args object.
  3. Check the trigger's definition in the editor to confirm which kind it is, then pass that exact kind.

Example fix

// before
await deployDraft({ type: 'trigger', path: 'u/hooks/ingest', workspace: 'demo' })
// Error: trigger_kind is required when deploying a trigger.

// after
await deployDraft({ type: 'trigger', path: 'u/hooks/ingest', workspace: 'demo', trigger_kind: 'webhook' })
Defensive patterns

Strategy: validation

Validate before calling

if (args.type === 'trigger' && !args.trigger_kind) {
  throw new Error('deploy: trigger_kind is required for triggers')
}
await deployDraft(args)

Type guard

function hasTriggerKind(args) {
  return args.type !== 'trigger' || typeof args.trigger_kind === 'string' && args.trigger_kind.length > 0
}

Try / catch

try {
  await deployDraft(args)
} catch (e) {
  if (/trigger_kind is required/.test(e.message)) {
    args.trigger_kind = resolveTriggerKind(args.path) // then retry
  } else throw e
}

Prevention

When it happens

Trigger: A deploy tool call with args.type === 'trigger' and args.trigger_kind undefined or empty — typically because the model omitted the trigger_kind parameter or the calling UI/CLI built the args without it.

Common situations: An LLM emits a deploy tool call missing the optional-looking trigger_kind field; custom tooling invokes the deploy handler for a trigger without forwarding the kind; schema drift between tool definition versions.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


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