{"record":{"id":"6d95285101333406","repo":"windmill-labs/windmill","slug":"failed-to-create-triggerconfig-label-request","errorCode":null,"errorMessage":"Failed to create ${triggerConfig.label} \"${requestBody.path}\": ${formatToolError(error)}","messagePattern":"Failed to create (.+?) \"(.+?)\": (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"frontend/src/lib/components/copilot/chat/workspaceTools.ts","lineNumber":497,"sourceCode":"\t\t\t\t\t...(emailAddress ? { email_address: emailAddress } : {})\n\t\t\t\t}\n\t\t\t\ttoolCallbacks.setToolStatus(toolId, {\n\t\t\t\t\tcontent: emailAddress\n\t\t\t\t\t\t? `Created ${triggerConfig.label} \"${requestBody.path}\" (send email to ${emailAddress})`\n\t\t\t\t\t\t: `Created ${triggerConfig.label} \"${requestBody.path}\"`,\n\t\t\t\t\tresult: toolResult,\n\t\t\t\t\tactions: [\n\t\t\t\t\t\tcreateOpenTriggerAction(\n\t\t\t\t\t\t\tparsedArgs.kind,\n\t\t\t\t\t\t\trequestBody.path,\n\t\t\t\t\t\t\ttargetKind,\n\t\t\t\t\t\t\ttriggerConfig.label\n\t\t\t\t\t\t)\n\t\t\t\t\t]\n\t\t\t\t})\n\t\t\t\treturn JSON.stringify(toolResult)\n\t\t\t} catch (error) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to create ${triggerConfig.label} \"${requestBody.path}\": ${formatToolError(error)}`\n\t\t\t\t)\n\t\t\t}\n\t\t} catch (error) {\n\t\t\treturn setToolError(toolCallbacks, toolId, error)\n\t\t}\n\t}\n}\n\nconst workspaceMutationTools = [\n\tcreateScheduleTool,\n\tcreateTriggerTool,\n\tgetTriggerSchemaTool,\n\tgetScheduleSchemaTool\n]\n\nexport function createWorkspaceMutationTools<T>(): Tool<T>[] {\n\treturn workspaceMutationTools as Tool<T>[]","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/copilot/chat/workspaceTools.ts#L479-L515","documentation":"create_trigger wraps its backend create call (per-kind Service, e.g. HttpTriggerService.createHttpTrigger) so any failure is rethrown as `Failed to create <label> \"<path>\": <detail>`. Args already passed zod validation, so this reflects server-side rejection of the trigger creation itself.","triggerScenarios":"The per-kind trigger Service returns an error: duplicate trigger path, invalid config for the kind (bad Kafka topic, missing Postgres column, unreachable AMQP/HTTP config), email trigger misconfiguration, or missing permissions.","commonSituations":"Config pointing at resources that don't exist or aren't reachable from the instance (Kafka brokers, Postgres connection); email trigger with a local_part colliding with an existing address; path already taken; workspace permissions too low.","solutions":["Read the wrapped backend detail and fix the offending config field","Verify external resources (broker URLs, DB connections, HTTP routes) are reachable and correct for the trigger kind","Use a unique trigger path, or delete the existing trigger at that path","Check workspace permissions for creating triggers of that kind"],"exampleFix":"// before\ncreate_trigger({ kind: 'kafka', path: 'u/u/kafka_t', config: { kafka_resource_path: 'u/u/k', topics: 'orders' } })\n// after (topics must be an array per schema)\ncreate_trigger({ kind: 'kafka', path: 'u/u/kafka_t', config: { kafka_resource_path: 'u/u/k', topics: ['orders'] } })","handlingStrategy":"try-catch","validationCode":"const existing = await listTriggers(workspace)\nif (existing.some((t) => t.path === path)) throw new Error(`Trigger ${path} already exists`)","typeGuard":null,"tryCatchPattern":"try {\n  await triggerConfig.create({ workspace, requestBody })\n} catch (e) {\n  const msg = (e as Error).message\n  if (/already exists/i.test(msg)) return createTrigger({ ...args, path: uniquePath() })\n  if (/config/i.test(msg)) return fixConfigPerKind(args) // per backend detail\n  throw e\n}","preventionTips":["Call get_trigger_schema for the kind and match config field names/types exactly","Pre-check that external systems (Kafka, Postgres, AMQP, HTTP routes) are reachable","Use unique trigger paths; delete stale triggers first","For email triggers, confirm email_domain is configured on the instance beforehand"],"tags":["triggers","api-error","permissions","copilot"],"backgroundTag":"api-request-failed","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"}