windmill-labs/windmill · error

A script already exists at '${path}'. Use edit_pipeline_node

Error message

A script already exists at '${path}'. Use edit_pipeline_node to change it instead.

What it means

Authoritative new-node check in pipelineAiHelpers proposeNode: the local graph may not have hydrated (it races open_preview and only lists pipeline runnables), so the backend is probed via getScriptByPath; any deployed script at that path means 'build new' would shadow it on deploy.

Source

Thrown at frontend/src/lib/components/assets/AssetGraph/pipelineAiHelpers.ts:263

				throw new Error(
					`A pipeline node already exists at '${path}'. Use edit_pipeline_node to change it instead.`
				)
			}
			// Authoritative new-node check: the resolved graph may not have hydrated yet
			// (the session preview can race open_preview), and it only lists pipeline
			// runnables — so probe the backend. ANY deployed script at this path means
			// "build new" would shadow it on deploy; the model should edit instead.
			const workspace = deps.getWorkspace()
			if (workspace) {
				let deployedExists = false
				try {
					await ScriptService.getScriptByPath({ workspace, path })
					deployedExists = true
				} catch {
					// 404 → no deployed script at this path, safe to create a new node.
				}
				if (deployedExists) {
					throw new Error(
						`A script already exists at '${path}'. Use edit_pipeline_node to change it instead.`
					)
				}
			}
			const inferred = await inferDraftAssets(language, content)
			// Fall back to a seeded output (from the declared output_kind) when the
			// body doesn't yet write anything inferable.
			const seeded =
				inferred.writes[0] ??
				(outputKind
					? autoOutputAsset(outputKind as PipelineOutputKind, folderName(), language)
					: undefined)
			// Effective outputs = what actually becomes an output edge on the canvas:
			// body/annotation-inferred writes, or the output_kind seed as a fallback.
			const outputAssets =
				inferred.writes.length > 0 ? inferred.writes : seeded ? [seeded] : undefined
			const next = new Map(drafts)
			next.set(path, {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Use edit_pipeline_node to modify the existing deployed script.
  2. Choose a different path that is not already deployed.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at frontend/src/lib/components/assets/AssetGraph/pipelineAiHelpers.ts:263 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/f156222c0ad3dae3. Report an issue: GitHub.