windmill-labs/windmill · error · Error

Invalid native trigger file path: ${filePath}. Expected form

Error message

Invalid native trigger file path: ${filePath}. Expected format: {script_path}.{flow|script}.{external_id}.{service}_native_trigger.json

What it means

`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.

Source

Thrown at cli/src/commands/trigger/trigger.ts:238

      throw e;
    }
  }
}

type NativeTriggerFile = Omit<
  NativeTrigger,
  "external_id" | "workspace_id" | "error"
>;

export async function pushNativeTrigger(
  workspace: string,
  filePath: string,
  _remoteTrigger: NativeTrigger | undefined,
  localTrigger: NativeTriggerFile
): Promise<void> {
  const triggerInfo = extractNativeTriggerInfo(filePath);
  if (!triggerInfo) {
    throw new Error(
      `Invalid native trigger file path: ${filePath}. Expected format: {script_path}.{flow|script}.{external_id}.{service}_native_trigger.json`
    );
  }

  const { externalId, serviceName } = triggerInfo;
  log.debug(
    `Processing local native trigger: service=${serviceName}, external_id=${externalId}`
  );

  let remoteTrigger: NativeTrigger | undefined;
  try {
    const result = await wmill.getNativeTrigger({
      workspace,
      serviceName: serviceName as NativeServiceName,
      externalId,
    });
    // getNativeTrigger returns NativeTriggerWithExternal, extract NativeTrigger fields
    remoteTrigger = {

View on GitHub (pinned to e474e8803c)

Solutions

  1. 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
  2. Ensure the external_id segment has no dots and the service name has only word characters
  3. Ensure the extension is lowercase .json or .yaml
  4. Regenerate the file with `wmill trigger new --kind <service>` or a fresh sync pull

Example fix

// before
flows/myflow.flow.trigger.json
// after
flows/myflow.flow.abc123.slack_native_trigger.json
Defensive patterns

Strategy: validation

Validate before calling

const NATIVE_RE = /^(.+)\.(flow|script)\.([^.]+)\.(\w+)_native_trigger\.(json|yaml)$/;
if (!NATIVE_RE.test(filePath.replaceAll("\\", "/"))) {
  throw new Error("rename before push: " + filePath);
}

Try / catch

try {
  await wmill.sync.push(opts);
} catch (e) {
  if (String(e.message).startsWith("Invalid native trigger file path")) {
    console.error("Rename the file to match: path.flow|script.<ext_id>.<service>_native_trigger.json");
  }
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


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