windmill-labs/windmill · error · Error
Invalid hub flow path: ${path}
Error message
Invalid hub flow path: ${path} What it means
loadSchema resolves the JSON schema for a script/flow being edited. For a flow whose path points at the Hub (isHubFlowPath true), it extracts the hub flow id from the path; if the path looks like a hub flow path but the id cannot be parsed out of it, it throws `Invalid hub flow path: <path>`. This is a malformed-path guard before calling FlowService.getHubFlowById.
Source
Thrown at frontend/src/lib/infer.ts:654
}
export async function loadSchema(
workspace: string,
path: string,
runType: 'script' | 'flow' | 'hubscript'
): Promise<{ schema: Schema; summary: string | undefined }> {
if (runType === 'script') {
const script = await ScriptService.getScriptByPath({
workspace,
path
})
return { schema: script.schema as any, summary: script.summary }
} else if (runType === 'flow') {
if (isHubFlowPath(path)) {
const hubFlowId = getHubFlowIdFromPath(path)
if (hubFlowId === undefined) {
throw new Error(`Invalid hub flow path: ${path}`)
}
const hub = await FlowService.getHubFlowById({ id: hubFlowId })
const flow = hub.flow
const schema =
flow?.schema && typeof flow.schema === 'object' && Object.keys(flow.schema).length > 0
? (flow.schema as any)
: emptySchema()
return { schema, summary: flow?.summary }
}
const flow = await FlowService.getFlowByPath({
workspace,
path
})
return { schema: flow.schema as any, summary: flow.summary }
} else {
const script = await ScriptService.getHubScriptByPath({View on GitHub (pinned to e474e8803c)
Solutions
- Inspect the printed path — it must contain a valid hub flow id where getHubFlowIdFromPath expects it.
- Re-select the hub flow from the Hub picker instead of typing the path by hand.
- Use the standard path format produced by the UI (e.g. `hub/<numeric-id>`) with no extra segments.
- Clear the stale path and browse the hub to get a fresh link.
Example fix
// before path = 'hub/https://hub.windmill.dev/flows/12/my_flow' // whole URL, id unparseable // after path = 'hub/12/my_flow' // id-parseable hub path
Defensive patterns
Strategy: validation
Validate before calling
function validHubFlowPath(path: string): boolean {
if (!isHubFlowPath(path)) return true // not a hub path, other handling applies
return getHubFlowIdFromPath(path) !== undefined
}
if (!validHubFlowPath(path)) throw new Error(`pick the hub flow from the Hub UI: '${path}'`) Type guard
function isParseableHubFlowPath(p: string): boolean {
return isHubFlowPath(p) && Number.isFinite(getHubFlowIdFromPath(p))
} Try / catch
try {
const schema = await loadSchema(path, runType)
} catch (e) {
if (e.message.startsWith('Invalid hub flow path')) openHubPicker()
else throw e
} Prevention
- Always select hub flows through the Hub picker, never paste URLs manually.
- Use the canonical `hub/<id>/...` path format.
- Validate paths in any custom tooling that writes flow paths.
When it happens
Trigger: loadSchema with runType 'flow' and a hub-style path (e.g. `hub/<id>` or similar pattern) whose id segment is empty, non-numeric, or doesn't match the expected getHubFlowIdFromPath pattern (e.g. `hub/` with no id, or a hand-typed path).
Common situations: Typing or pasting a hub flow URL/path manually into the path field with extra segments or missing the id; a stale bookmark to a removed hub flow format; constructing paths programmatically with an undefined id.
Related errors
- Cannot push flow ${remotePath}: step(s) reference non-worksp
- Invalid failure_module: only "rawscript" and "script" module
- not a flow
- Cannot push flow ${remotePath}: missing inline script file(s
- Flow path must be a .flow/__flow directory or a flow.yaml fi
AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03).
Data as JSON: /api/errors/8b4520e63d20bd41.
Report an issue: GitHub.