windmill-labs/windmill · error

Cannot push flow ${remotePath}: missing inline script file(s

Error message

Cannot push flow ${remotePath}: missing inline script file(s): ${missingFiles.join(", ")}. Either restore the file(s) or remove the !inline reference(s) from flow.yaml before pushing.

What it means

`wmill flow push` resolves `!inline <path>` references in flow.yaml to local script files. If any referenced files are missing, it hard-fails with this error listing them instead of pushing the literal `!inline path` text as script content — that string would be persisted in flow_version.value and corrupt the flow on the next pull (GIT-871 / #9140).

Source

Thrown at cli/src/commands/flow/flow.ts:217

    fileReader,
    log,
    localPath,
    SEP,
    undefined,
    missingFiles
  );
  if (localFlow.value.failure_module) {
    await replaceInlineScripts([localFlow.value.failure_module], fileReader, log, localPath, SEP, undefined, missingFiles);
  }
  if (localFlow.value.preprocessor_module) {
    await replaceInlineScripts([localFlow.value.preprocessor_module], fileReader, log, localPath, SEP, undefined, missingFiles);
  }
  if (missingFiles.length > 0) {
    // Hard-fail rather than push the literal `!inline path` text as
    // rawscript.content. That string would be persisted in flow_version.value
    // and round-trip as the script body on the next pull, overwriting the
    // user's local handler with the directive — see GIT-871 / #9140.
    throw new Error(
      `Cannot push flow ${remotePath}: missing inline script file(s): ${missingFiles.join(", ")}. ` +
      `Either restore the file(s) or remove the !inline reference(s) from flow.yaml before pushing.`
    );
  }

  // Reject script/sub-flow steps whose path is not a workspace path (u/, f/, g/ or hub/).
  // A flow.yaml generated from a feature-branch checkout can carry absolute local paths
  // (e.g. /tmp/.../ops/scripts/...); pushed, they silently mis-resolve at runtime (#9751).
  // The backend re-validates the same rule for every step type, so this is a fail-fast.
  const badStepPaths = collectStepPaths(localFlow.value).filter(
    (p) => p !== "" && !/^(u|f|g|hub)\//.test(p)
  );
  if (badStepPaths.length > 0) {
    throw new Error(
      `Cannot push flow ${remotePath}: step(s) reference non-workspace path(s): ${badStepPaths.join(", ")}. ` +
      `Flow step paths must be workspace paths (u/, f/, g/ or hub/), not absolute or local filesystem paths. ` +
      `This usually means flow.yaml was generated with paths from a checkout directory.`
    );

View on GitHub (pinned to e474e8803c)

Solutions

  1. Restore the missing inline files listed in the error (git checkout / re-pull the flow).
  2. Remove the `!inline` references from flow.yaml if the files are intentionally gone.
  3. Run push from the flow's root directory so relative paths resolve.
  4. Inspect flow.yaml for stale `!inline` entries and fix their paths.

Example fix

// before (flow.yaml)
content: !inline ops/removed_script.ts
// after
git checkout -- ops/removed_script.ts  # or remove the !inline step from flow.yaml
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync, readFileSync } from 'node:fs';
const yaml = readFileSync('flow.yaml', 'utf8');
const missing = [...yaml.matchAll(/!inline (.+)/g)].map(m => m[1]).filter(p => !existsSync(p));
if (missing.length) throw new Error('missing inline files: ' + missing.join(', '));

Type guard

null

Try / catch

try { await pushFlow(...) } catch (e) { if (String(e).includes('missing inline script file')) restoreFromGit(e); else throw e; }

Prevention

When it happens

Trigger: Pushing a flow whose flow.yaml contains `!inline` references to files that don't exist locally — files deleted, wrong relative path, flow.yaml copied from another checkout, or running push from the wrong cwd so relative paths don't resolve.

Common situations: Cleaning untracked files with git clean before pushing; partial git checkout; renamed/moved inline script files without updating flow.yaml; CI checking out only flow.yaml.

Related errors


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