{"record":{"id":"7f1a9d01e3d4c3ba","repo":"FlowiseAI/Flowise","slug":"invalid-base-url-must-be-a-valid-url-7f1a9d","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/AgentAsTool/AgentAsTool.ts","lineNumber":177,"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 agentflowid is a valid UUID\n        if (!selectedAgentflowId || !isValidUUID(selectedAgentflowId)) {\n            throw new Error('Invalid agentflow 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 agentflowApiKey = getCredentialParam('agentflowApiKey', credentialData, nodeData)\n\n        if (selectedAgentflowId === options.chatflowid) throw new Error('Cannot call the same agentflow!')\n\n        let headers = {}\n        if (agentflowApiKey) headers = { Authorization: `Bearer ${agentflowApiKey}` }\n\n        let toolInput = ''\n        if (useQuestionFromChat) {\n            toolInput = input\n        } else if (customInput) {\n            toolInput = customInput\n        }\n\n        let name = _name || 'agentflow_tool'","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/AgentAsTool/AgentAsTool.ts#L159-L195","documentation":"Thrown in AgentAsTool_Tools.init when baseURL is falsy or fails isValidURL. baseURL is the host of the agentflow HTTP API; it falls back to options.baseURL, so the error means neither the node input nor the server default is a usable absolute URL. Without a valid base the tool cannot construct the fetch target.","triggerScenarios":"Node inputs.baseURL is empty AND options.baseURL is undefined (e.g. running outside the normal server context, or in a test harness); baseURL was entered as a hostname without scheme ('localhost:3000') or with a trailing path that breaks URL composition.","commonSituations":"Self-hosted deployment where BASE_URL env var was not set; behind a reverse proxy and the configured URL used http vs https inconsistently; local dev entered '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 the server's BASE_URL/config is set and propagated into options.baseURL.","Strip any trailing slash or path from baseURL — only the origin should be configured."],"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)\nconst baseURL = rawBase ? new URL(rawBase).origin : ''\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 (http:// or https://) in baseURL.","Set BASE_URL at the server level so options.baseURL is the safety net.","Use only the origin; avoid trailing paths or slashes."],"tags":["validation","url","config","agentflow"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}