windmill-labs/windmill · warning
--arg for ${p} is unused — it isn't in the run selection.
Error message
--arg for ${p} is unused — it isn't in the run selection. What it means
In `wmill pipeline run`, a plain --arg whose target script is not in the final run selection is silently ignored, so the CLI warns per path, mirroring the --upload warning. It flags args that will never reach a step in this run.
Source
Thrown at cli/src/commands/pipeline/pipeline.ts:914
const unresolvable = order.filter(
(p) => partitionKindByPath.get(p) === "dynamic",
);
if (unresolvable.length > 0) {
throw new Error(
`dynamic \`// partitioned\` script(s) need an explicit partition for a local run: ${unresolvable.sort().join(", ")} — pass --partition <value>.`,
);
}
}
// A `--upload` whose script fell outside the selection is a no-op the user
// should know about, rather than silently ignored.
const orderSet = new Set(order);
const boundInOrder = [...boundBindingsByPath.keys()].filter((p) => orderSet.has(p)).sort();
for (const p of boundBindingsByPath.keys()) {
if (!orderSet.has(p)) log.warn(`--upload for ${p} is unused — it isn't in the run selection.`);
}
for (const p of plainArgsByPath.keys()) {
if (!orderSet.has(p)) log.warn(`--arg for ${p} is unused — it isn't in the run selection.`);
}
if (opts.json) {
// Surface reachable/dropped ends so a machine-readable plan reflects the
// same trimming the human-facing warning does — a resolved-but-unreachable
// `--to` must not look like a clean plan that silently runs only the start.
console.log(
JSON.stringify({
start: runAll ? null : scriptPathOf(start!),
ends: ends.map(idLabel),
reachableEnds: reachableEnds.map(idLabel),
droppedEnds: droppedEnds.map(idLabel),
order,
cyclic,
uploads: boundInOrder,
}),
);
}View on GitHub (pinned to e474e8803c)
Solutions
- Widen the run selection (--start/--end, avoid cutting barriers) so the target script is included.
- Fix the script path in --arg if it is wrong.
- Drop the unused --arg flag.
- Use --json to inspect the plan's selected/trimmed nodes before running.
Example fix
// before: arg target outside window wmill pipeline run f/myflow --start a --end b --arg f/myflow/z=42 // after wmill pipeline run f/myflow --start a --end z --arg f/myflow/z=42
Defensive patterns
Strategy: validation
Validate before calling
// confirm every --arg target is inside the planned selection
const plan = JSON.parse(execSync('wmill pipeline run f/x --start a --end b --json').toString());
const args = ['f/myflow/z'];
const missing = args.filter(p => !plan.order.includes(p));
if (missing.length) throw new Error(`--arg targets not in selection: ${missing}`); Prevention
- Pair each --arg with a script verified to be in the run window.
- Check the --json plan's selected nodes before running.
- Update arg paths after renaming flow steps.
- Prefer narrowing with --start/--end first, then add args for nodes confirmed in order.
When it happens
Trigger: Passing --arg <path>=<value> for a script excluded by the --start/--end window, barriers, cycles, or not-runnable filtering, or with a mistyped script path.
Common situations: Reusing an old command line after narrowing the run window; arg paths not updated after scripts were renamed; args intended for steps behind a barrier.
Related errors
- --upload for ${p} is unused — it isn't in the run selection.
- end '${idLabel(d)}' is not downstream of the start — ignored
- end '${idLabel(e)}' is only reachable through a skipped inpu
- Skipping ${cyclic.length} script(s) on a dependency cycle: $
- App ${appPath} not found
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/dbcea78002e87a3f.
Report an issue: GitHub.