{"record":{"id":"bb316342fb17260d","repo":"FlowiseAI/Flowise","slug":"invalid-base-url-must-be-a-valid-url","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/agentflow/ExecuteFlow/ExecuteFlow.ts","lineNumber":187,"sourceCode":"        let overrideConfig = nodeData.inputs?.executeFlowOverrideConfig\n        if (typeof overrideConfig === 'string' && overrideConfig.startsWith('{') && overrideConfig.endsWith('}')) {\n            try {\n                overrideConfig = parseJsonBody(overrideConfig)\n            } catch (parseError) {\n                throw new Error(`Invalid JSON in executeFlowOverrideConfig: ${parseError.message}`)\n            }\n        }\n\n        const state = options.agentflowRuntime?.state as ICommonObject\n        const runtimeChatHistory = (options.agentflowRuntime?.chatHistory as BaseMessageLike[]) ?? []\n        const isLastNode = options.isLastNode as boolean\n        const sseStreamer: IServerSideEventStreamer | undefined = options.sseStreamer\n\n        try {\n            const credentialData = await getCredentialData(nodeData.credential ?? '', options)\n            const chatflowApiKey = getCredentialParam('chatflowApiKey', credentialData, nodeData)\n\n            if (!baseURL || !isValidURL(baseURL)) throw new Error('Invalid base URL: must be a valid URL')\n\n            if (selectedFlowId === options.chatflowid) throw new Error('Cannot call the same agentflow!')\n\n            let headers: Record<string, string> = {\n                'Content-Type': 'application/json',\n                'flowise-tool': 'true'\n            }\n            if (chatflowApiKey) headers = { ...headers, Authorization: `Bearer ${chatflowApiKey}` }\n\n            const finalUrl = `${baseURL}/api/v1/prediction/${selectedFlowId}`\n            const requestConfig: AxiosRequestConfig = {\n                method: 'POST',\n                url: finalUrl,\n                headers,\n                data: {\n                    question: flowInput,\n                    chatId: options.chatId,\n                    overrideConfig","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/agentflow/ExecuteFlow/ExecuteFlow.ts#L169-L205","documentation":"ExecuteFlow.run resolves baseURL from nodeData.inputs.executeFlowBaseURL or options.baseURL, then requires it to be truthy and pass isValidURL. An empty or malformed URL aborts before the prediction request is built. This guards the outbound POST to ${baseURL}/api/v1/prediction/${selectedFlowId}.","triggerScenarios":"executeFlowBaseURL left empty and no options.baseURL provided; baseURL missing the scheme (e.g. 'localhost:3000'); URL with spaces or invalid characters; baseURL set to a relative path; trailing slash or typo breaking URL parsing.","commonSituations":"Environment where options.baseURL is not injected; node configured with a placeholder like '<your-url>'; copy-paste including quotes or whitespace; reverse-proxy/domain change not reflected in the node config.","solutions":["Set executeFlowBaseURL to a full absolute URL including scheme, e.g. 'https://flowise.example.com'.","If relying on options.baseURL, ensure the runtime injects it (check the host/orchestrator config).","Trim whitespace and remove surrounding quotes from the value.","Verify the URL with `new URL(baseURL)` in a scratch script."],"exampleFix":"// before\nexecuteFlowBaseURL = 'localhost:3000'\n\n// after\nexecuteFlowBaseURL = 'http://localhost:3000'","handlingStrategy":"validation","validationCode":"function resolveBaseURL(nodeData, options) {\n  const url = (nodeData.inputs?.executeFlowBaseURL as string) || (options.baseURL as string)\n  try { new URL(url) }\n  catch { throw new Error('executeFlowBaseURL must be a valid absolute URL, e.g. https://host') }\n  return url\n}","typeGuard":"function isValidHttpUrl(s) {\n  try { const u = new URL(s); return u.protocol === 'http:' || u.protocol === 'https:' }\n  catch { return false }\n}","tryCatchPattern":"try { await executeFlow.run(nodeData, '', options) }\ncatch (e) {\n  if (e.message === 'Invalid base URL: must be a valid URL') {\n    // set executeFlowBaseURL to a valid absolute URL and retry\n  } else throw e\n}","preventionTips":["Default executeFlowBaseURL from a central config/env var.","Validate the URL with `new URL(...)` in the UI on save.","Strip whitespace and quotes before storing the value."],"tags":["execute-flow","validation","url","configuration"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}