{"record":{"id":"14796f71c0d5be74","repo":"windmill-labs/windmill","slug":"invalid-native-trigger-file-path-filepath-exp","errorCode":null,"errorMessage":"Invalid native trigger file path: ${filePath}. Expected format: {script_path}.{flow|script}.{external_id}.{service}_native_trigger.json","messagePattern":"Invalid native trigger file path: (.+?)\\. Expected format: (.+?)\\.(.+?)\\.(.+?)\\.(.+?)_native_trigger\\.json","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/trigger/trigger.ts","lineNumber":238,"sourceCode":"      throw e;\n    }\n  }\n}\n\ntype NativeTriggerFile = Omit<\n  NativeTrigger,\n  \"external_id\" | \"workspace_id\" | \"error\"\n>;\n\nexport async function pushNativeTrigger(\n  workspace: string,\n  filePath: string,\n  _remoteTrigger: NativeTrigger | undefined,\n  localTrigger: NativeTriggerFile\n): Promise<void> {\n  const triggerInfo = extractNativeTriggerInfo(filePath);\n  if (!triggerInfo) {\n    throw new Error(\n      `Invalid native trigger file path: ${filePath}. Expected format: {script_path}.{flow|script}.{external_id}.{service}_native_trigger.json`\n    );\n  }\n\n  const { externalId, serviceName } = triggerInfo;\n  log.debug(\n    `Processing local native trigger: service=${serviceName}, external_id=${externalId}`\n  );\n\n  let remoteTrigger: NativeTrigger | undefined;\n  try {\n    const result = await wmill.getNativeTrigger({\n      workspace,\n      serviceName: serviceName as NativeServiceName,\n      externalId,\n    });\n    // getNativeTrigger returns NativeTriggerWithExternal, extract NativeTrigger fields\n    remoteTrigger = {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/trigger/trigger.ts#L220-L256","documentation":"`pushNativeTrigger` (invoked from the sync push machinery via pushObj) derives the trigger's external ID and service from the local filename using `extractNativeTriggerInfo`. When the filename doesn't match {script_path}.{flow|script}.{external_id}.{service}_native_trigger.json, it cannot know which remote trigger to create/update and throws this error with the expected format in the message.","triggerScenarios":"Running `wmill sync push` with a native trigger file whose name was renamed, created by hand, or produced by an older tool version: missing the .flow/.script segment, missing external_id, service containing a dash, or wrong extension (.yml, .json.bak).","commonSituations":"Hand-copying trigger files between scripts, git renames, Windows path separators normalized away breaking the regex, or creating files via `wmill trigger new` with a malformed path base.","solutions":["Rename the file to exactly {script_path}.{flow|script}.{external_id}.{external_id}.{service}_native_trigger.json — i.e. path.flow.12345.nextcloud_native_trigger.json","Ensure the external_id segment has no dots and the service name has only word characters","Ensure the extension is lowercase .json or .yaml","Regenerate the file with `wmill trigger new --kind <service>` or a fresh sync pull"],"exampleFix":"// before\nflows/myflow.flow.trigger.json\n// after\nflows/myflow.flow.abc123.slack_native_trigger.json","handlingStrategy":"validation","validationCode":"const NATIVE_RE = /^(.+)\\.(flow|script)\\.([^.]+)\\.(\\w+)_native_trigger\\.(json|yaml)$/;\nif (!NATIVE_RE.test(filePath.replaceAll(\"\\\\\", \"/\"))) {\n  throw new Error(\"rename before push: \" + filePath);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await wmill.sync.push(opts);\n} catch (e) {\n  if (String(e.message).startsWith(\"Invalid native trigger file path\")) {\n    console.error(\"Rename the file to match: path.flow|script.<ext_id>.<service>_native_trigger.json\");\n  }\n}","preventionTips":["Generate native trigger files only via `wmill trigger new --kind <service>` or sync pull","Validate filenames in pre-commit hooks","Never strip the external_id or service segments when renaming"],"tags":["cli","native-trigger","sync","path-format","push"],"backgroundTag":"invalid-native-trigger-path","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"}