windmill-labs/windmill · error · Error

Invalid config for a "${parsed.kind}" trigger. Call get_trig

Error message

Invalid config for a "${parsed.kind}" trigger. Call get_trigger_schema with kind "${parsed.kind}" for its exact fields. Issues: ${config.error.issues.map((i) => `${i.path.join('.') || '<root>'}: ${i.message}`).join('; ')}

What it means

After parsing the overall write_trigger args, the per-kind config is validated with triggerRequestSchemas[kind]. If the config does not match the schema for the declared kind, this error lists the zod issue paths and messages and directs the model to get_trigger_schema for the exact fields.

Source

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

	{
		def: createToolDef(
			writeTriggerSchema,
			'write_trigger',
			'Create or overwrite a draft trigger.',
			{ strict: false }
		),
		showDetails: true,
		streamArguments: true,
		showFade: true,
		fn: async (ctx) => {
			const parsed = writeTriggerSchema.parse(ctx.args)
			// writeTriggerDraft dispatches on `kind`, so a config belonging to another kind
			// has to be rejected here rather than reaching the API as a corrupt draft. The
			// recovery instruction leads because formatToolError caps the message at 2k and
			// a long issue list would otherwise push it out of what the model receives.
			const config = triggerRequestSchemas[parsed.kind].safeParse(parsed.config)
			if (!config.success) {
				throw new Error(
					`Invalid config for a "${parsed.kind}" trigger. Call get_trigger_schema with kind "${parsed.kind}" for its exact fields. Issues: ${config.error.issues
						.map((i) => `${i.path.join('.') || '<root>'}: ${i.message}`)
						.join('; ')}`
				)
			}
			return writeTriggerDraft({ ...parsed, config: config.data }, ctx)
		}
	},
	{
		def: createToolDef(
			getTriggerSchemaSchema,
			'get_trigger_schema',
			'Get the configuration schema for one trigger kind. Call before write_trigger.'
		),
		planModeSafe: true,
		fn: async (ctx) => {
			const { kind } = getTriggerSchemaSchema.parse(ctx.args)
			return triggerConfigJsonSchema(kind)

View on GitHub (pinned to e474e8803c)

Solutions

  1. Call get_trigger_schema with the same kind to get the exact field list
  2. Fix the config fields per the listed issue paths and retry write_trigger
  3. Verify the kind matches the config you are actually passing

Example fix

// before
writeTrigger({ kind: 'websocket', config: { path: 'x', email: 'a@b.c' } })
// after
writeTrigger({ kind: 'websocket', config: { path: 'x', filters: [] } })
Defensive patterns

Strategy: validation

Validate before calling

const config = triggerRequestSchemas[kind].safeParse(parsed.config);
if (!config.success) {
  console.log(config.error.issues.map(i => `${i.path.join('.')}: ${i.message}`));
  throw new Error('fix config before writing trigger');
}

Type guard

function configMatchesKind(kind, config) { return triggerRequestSchemas[kind].safeParse(config).success; }

Try / catch

try { writeTrigger(args) } catch (e) { if (e.message.includes('Invalid config')) await getTriggerSchema(kind) and retry; }

Prevention

When it happens

Trigger: A write_trigger tool call passes a config whose shape fails safeParse for parsed.kind — e.g. a websocket trigger config missing its filters, or config fields belonging to a different trigger kind.

Common situations: The model mixes field sets between trigger kinds (e.g. email fields in a webhook trigger), omits required fields, or misspells option names.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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