windmill-labs/windmill · error

No flow draft found for "${path}".

Error message

No flow draft found for "${path}".

What it means

Thrown by rebaseFlowDraft when no flow draft is stored for the path (or the draft value is a string/undefined rather than a flow object). Rebase diffs the draft against a newer deployed version; without a draft there is nothing to re-apply, so the tool refuses instead of returning a null diff.

Source

Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6294

			success: true,
			message:
				`Discarded the stale draft for "${path}". Your changes are in "your_changes" (a diff against the ` +
				`version you forked from). Re-apply them with edit_script / write_script — the new draft will be ` +
				`based on the latest deployed version (hash ${latest.hash}) — then deploy.`,
			latest_hash: latest.hash,
			your_changes: yourChanges
		},
		null,
		2
	)
}

async function rebaseFlowDraft(path: string, ctx: WriteDraftCtx): Promise<string> {
	const { workspace, toolId, toolCallbacks } = ctx

	const draft = await getGlobalDraft(workspace, 'flow', path)
	if (!draft || draft.value === undefined || typeof draft.value === 'string') {
		throw new Error(`No flow draft found for "${path}".`)
	}
	if (!(await FlowService.existsFlowByPath({ workspace, path }))) {
		throw new Error(`Flow "${path}" is not deployed; there is no newer version to rebase onto.`)
	}

	const latest = await FlowService.getFlowByPath({ workspace, path })
	const baseVersion = draft.parentVersionId
	if (baseVersion != null && baseVersion === latest.version_id) {
		const message = `Draft "${path}" is already based on the latest deployed version (${latest.version_id}).`
		toolCallbacks.setToolStatus(toolId, { content: message })
		return JSON.stringify({
			success: true,
			alreadyLatest: true,
			latest_version: latest.version_id,
			message
		})
	}

View on GitHub (pinned to e474e8803c)

Solutions

  1. Create a flow draft with the flow edit tools before rebasing
  2. Confirm the path matches the item you forked
  3. If the draft was already discarded, re-apply the saved your_changes diff with the flow edit tools
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at frontend/src/lib/components/copilot/chat/global/core.ts:6294 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/5b020d93d7b6d4f6. Report an issue: GitHub.