{"record":{"id":"0fdab777e15c883d","repo":"FlowiseAI/Flowise","slug":"invalid-base-url-must-be-a-valid-url-0fdab7","errorCode":null,"errorMessage":"Invalid base URL: must be a valid URL","messagePattern":"Invalid base URL: must be a valid URL","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts","lineNumber":185,"sourceCode":"        const overrideConfig =\n            typeof nodeData.inputs?.overrideConfig === 'string' &&\n            nodeData.inputs.overrideConfig.startsWith('{') &&\n            nodeData.inputs.overrideConfig.endsWith('}')\n                ? JSON.parse(nodeData.inputs.overrideConfig)\n                : nodeData.inputs?.overrideConfig\n\n        const startNewSession = nodeData.inputs?.startNewSession as boolean\n\n        const baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)\n\n        // Validate selectedChatflowId is a valid UUID\n        if (!selectedChatflowId || !isValidUUID(selectedChatflowId)) {\n            throw new Error('Invalid chatflow ID: must be a valid UUID')\n        }\n\n        // Validate baseURL is a valid URL\n        if (!baseURL || !isValidURL(baseURL)) {\n            throw new Error('Invalid base URL: must be a valid URL')\n        }\n\n        const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const chatflowApiKey = getCredentialParam('chatflowApiKey', credentialData, nodeData)\n\n        if (selectedChatflowId === options.chatflowid) throw new Error('Cannot call the same chatflow!')\n\n        let headers = {}\n        if (chatflowApiKey) headers = { Authorization: `Bearer ${chatflowApiKey}` }\n\n        let toolInput = ''\n        if (useQuestionFromChat) {\n            toolInput = input\n        } else if (customInput) {\n            toolInput = customInput\n        }\n\n        let name = _name || 'chatflow_tool'","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts#L167-L203","documentation":"Thrown in ChatflowTool_Tools.init when baseURL is falsy or fails isValidURL. Same contract as error 345 for the agentflow variant: baseURL (from node input or options.baseURL fallback) must be a valid absolute URL so the tool can build the chatflow prediction HTTP request.","triggerScenarios":"Node inputs.baseURL empty and options.baseURL undefined; baseURL given as a bare hostname; baseURL with a wrong scheme or trailing path that isValidURL rejects.","commonSituations":"Self-hosted deploy with BASE_URL unset; reverse-proxy scheme mismatch; local dev using 'localhost:3000' instead of 'http://localhost:3000'.","solutions":["Set inputs.baseURL to an absolute URL including scheme (e.g. https://app.example.com).","If relying on the server default, ensure options.baseURL is populated from server config.","Use only the origin — strip trailing path/slash."],"exampleFix":"// before\nconst baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)\n// after\nconst rawBase = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)\nlet baseURL = ''\ntry { baseURL = rawBase ? new URL(rawBase).origin : '' } catch {}\nif (!baseURL || !isValidURL(baseURL)) {\n  throw new Error('Invalid base URL: must be a valid URL')\n}","handlingStrategy":"validation","validationCode":"import { isValidURL } from '../../../src/validator'\nfunction resolveBaseURL(node: INodeData, options: ICommonObject): string {\n  const raw = (node.inputs?.baseURL as string) || (options.baseURL as string)\n  const base = raw ? new URL(raw).origin : ''\n  if (!base || !isValidURL(base)) throw new Error('Invalid base URL: must be a valid URL')\n  return base\n}","typeGuard":"function isAbsoluteUrl(v: unknown): v is string {\n  if (typeof v !== 'string') return false\n  try { new URL(v); return true } catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Always include the scheme in baseURL.","Set BASE_URL at the server level so options.baseURL is a reliable fallback.","Use only the origin — no trailing path or slash."],"tags":["validation","url","config","chatflow"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}