{"record":{"id":"dbcea78002e87a3f","repo":"windmill-labs/windmill","slug":"arg-for-p-is-unused-it-isn-t-in-the-run-sel","errorCode":null,"errorMessage":"--arg for ${p} is unused — it isn't in the run selection.","messagePattern":"--arg for (.+?) is unused — it isn't in the run selection\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/commands/pipeline/pipeline.ts","lineNumber":914,"sourceCode":"    const unresolvable = order.filter(\n      (p) => partitionKindByPath.get(p) === \"dynamic\",\n    );\n    if (unresolvable.length > 0) {\n      throw new Error(\n        `dynamic \\`// partitioned\\` script(s) need an explicit partition for a local run: ${unresolvable.sort().join(\", \")} — pass --partition <value>.`,\n      );\n    }\n  }\n\n  // A `--upload` whose script fell outside the selection is a no-op the user\n  // should know about, rather than silently ignored.\n  const orderSet = new Set(order);\n  const boundInOrder = [...boundBindingsByPath.keys()].filter((p) => orderSet.has(p)).sort();\n  for (const p of boundBindingsByPath.keys()) {\n    if (!orderSet.has(p)) log.warn(`--upload for ${p} is unused — it isn't in the run selection.`);\n  }\n  for (const p of plainArgsByPath.keys()) {\n    if (!orderSet.has(p)) log.warn(`--arg for ${p} is unused — it isn't in the run selection.`);\n  }\n\n  if (opts.json) {\n    // Surface reachable/dropped ends so a machine-readable plan reflects the\n    // same trimming the human-facing warning does — a resolved-but-unreachable\n    // `--to` must not look like a clean plan that silently runs only the start.\n    console.log(\n      JSON.stringify({\n        start: runAll ? null : scriptPathOf(start!),\n        ends: ends.map(idLabel),\n        reachableEnds: reachableEnds.map(idLabel),\n        droppedEnds: droppedEnds.map(idLabel),\n        order,\n        cyclic,\n        uploads: boundInOrder,\n      }),\n    );\n  }","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/commands/pipeline/pipeline.ts#L896-L932","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before: arg target outside window\nwmill pipeline run f/myflow --start a --end b --arg f/myflow/z=42\n// after\nwmill pipeline run f/myflow --start a --end z --arg f/myflow/z=42","handlingStrategy":"validation","validationCode":"// confirm every --arg target is inside the planned selection\nconst plan = JSON.parse(execSync('wmill pipeline run f/x --start a --end b --json').toString());\nconst args = ['f/myflow/z'];\nconst missing = args.filter(p => !plan.order.includes(p));\nif (missing.length) throw new Error(`--arg targets not in selection: ${missing}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["cli","pipeline","unused-argument","dag"],"backgroundTag":"unused-cli-argument","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"}