{"record":{"id":"8b4520e63d20bd41","repo":"windmill-labs/windmill","slug":"invalid-hub-flow-path-path","errorCode":null,"errorMessage":"Invalid hub flow path: ${path}","messagePattern":"Invalid hub flow path: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/src/lib/infer.ts","lineNumber":654,"sourceCode":"}\n\nexport async function loadSchema(\n\tworkspace: string,\n\tpath: string,\n\trunType: 'script' | 'flow' | 'hubscript'\n): Promise<{ schema: Schema; summary: string | undefined }> {\n\tif (runType === 'script') {\n\t\tconst script = await ScriptService.getScriptByPath({\n\t\t\tworkspace,\n\t\t\tpath\n\t\t})\n\n\t\treturn { schema: script.schema as any, summary: script.summary }\n\t} else if (runType === 'flow') {\n\t\tif (isHubFlowPath(path)) {\n\t\t\tconst hubFlowId = getHubFlowIdFromPath(path)\n\t\t\tif (hubFlowId === undefined) {\n\t\t\t\tthrow new Error(`Invalid hub flow path: ${path}`)\n\t\t\t}\n\t\t\tconst hub = await FlowService.getHubFlowById({ id: hubFlowId })\n\t\t\tconst flow = hub.flow\n\t\t\tconst schema =\n\t\t\t\tflow?.schema && typeof flow.schema === 'object' && Object.keys(flow.schema).length > 0\n\t\t\t\t\t? (flow.schema as any)\n\t\t\t\t\t: emptySchema()\n\t\t\treturn { schema, summary: flow?.summary }\n\t\t}\n\n\t\tconst flow = await FlowService.getFlowByPath({\n\t\t\tworkspace,\n\t\t\tpath\n\t\t})\n\n\t\treturn { schema: flow.schema as any, summary: flow.summary }\n\t} else {\n\t\tconst script = await ScriptService.getHubScriptByPath({","sourceCodeStart":636,"sourceCodeEnd":672,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/infer.ts#L636-L672","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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."],"exampleFix":"// before\npath = 'hub/https://hub.windmill.dev/flows/12/my_flow' // whole URL, id unparseable\n// after\npath = 'hub/12/my_flow' // id-parseable hub path","handlingStrategy":"validation","validationCode":"function validHubFlowPath(path: string): boolean {\n  if (!isHubFlowPath(path)) return true // not a hub path, other handling applies\n  return getHubFlowIdFromPath(path) !== undefined\n}\nif (!validHubFlowPath(path)) throw new Error(`pick the hub flow from the Hub UI: '${path}'`)","typeGuard":"function isParseableHubFlowPath(p: string): boolean {\n  return isHubFlowPath(p) && Number.isFinite(getHubFlowIdFromPath(p))\n}","tryCatchPattern":"try {\n  const schema = await loadSchema(path, runType)\n} catch (e) {\n  if (e.message.startsWith('Invalid hub flow path')) openHubPicker()\n  else throw e\n}","preventionTips":["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."],"tags":["path-validation","hub","flow","schema"],"backgroundTag":"invalid-path-format","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"}