windmill-labs/windmill · error · Error

--from '${opts.from}' is a `// macros` library — definition-

Error message

--from '${opts.from}' is a `// macros` library — definition-only, injected into consuming scripts at run time, never a runnable step.

What it means

Kind guard for --from in the pipeline run command: the token resolved to a node that is a // macros library — a definition-only script whose exports get injected into consuming scripts at run time. Macros libraries are never executable steps, so they cannot start a run. The input at fault is a --from pointing at a macros library path.

Source

Thrown at cli/src/commands/pipeline/pipeline.ts:743

  let runAll = false;
  let start: string | undefined;
  if (opts.from) {
    const resolved = resolveToken(graph, opts.from);
    if (!resolved) {
      // Distinguish "no match" from "ambiguous short name" (resolveToken
      // returns undefined for both) so the hint is actionable.
      const matches = graph.runnables.filter(
        (r) => r.usage_kind === "script" && (r.path.split("/").pop() ?? r.path) === opts.from,
      );
      if (matches.length > 1) {
        throw new Error(
          `--from '${opts.from}' matches multiple scripts (${matches.map((r) => r.path).sort().join(", ")}) — pass the full path.`,
        );
      }
      throw new Error(`--from '${opts.from}' matched no script in f/${f}.`);
    }
    if (macroLibPaths.has(scriptPathOf(resolved))) {
      throw new Error(
        `--from '${opts.from}' is a \`// macros\` library — definition-only, injected into consuming scripts at run time, never a runnable step.`,
      );
    }
    // A `--local` display-only node (a non-`// pipeline` DuckDB script surfaced
    // only because it calls a macro) has no previewable content — reject it
    // clearly rather than admitting it and silently producing an empty plan.
    if (notRunnablePaths.has(scriptPathOf(resolved))) {
      throw new Error(
        `--from '${opts.from}' isn't a \`// pipeline\` script — it appears in the local graph only as a macro consumer (lineage). Mark it \`// pipeline\` to run it.`,
      );
    }
    if (!resolved.startsWith("script:")) {
      throw new Error(
        `--from '${opts.from}' is an asset, not a runnable — start a run from a script (assets are produced, not run).`,
      );
    }
    if (!fromEligible.has(resolved)) {
      throw new Error(

View on GitHub (pinned to e474e8803c)

Solutions

  1. Start the run from a consuming // pipeline script instead — the macros library will be injected automatically
  2. If this script was mislabeled, remove the // macros marker so it becomes a normal runnable script
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/pipeline/pipeline.ts:743 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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