FlowiseAI/Flowise · error · Error
Invalid base URL: must be a valid URL
Error message
Invalid base URL: must be a valid URL
What it means
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.
Source
Thrown at packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts:185
const overrideConfig =
typeof nodeData.inputs?.overrideConfig === 'string' &&
nodeData.inputs.overrideConfig.startsWith('{') &&
nodeData.inputs.overrideConfig.endsWith('}')
? JSON.parse(nodeData.inputs.overrideConfig)
: nodeData.inputs?.overrideConfig
const startNewSession = nodeData.inputs?.startNewSession as boolean
const baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)
// Validate selectedChatflowId is a valid UUID
if (!selectedChatflowId || !isValidUUID(selectedChatflowId)) {
throw new Error('Invalid chatflow ID: must be a valid UUID')
}
// Validate baseURL is a valid URL
if (!baseURL || !isValidURL(baseURL)) {
throw new Error('Invalid base URL: must be a valid URL')
}
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
const chatflowApiKey = getCredentialParam('chatflowApiKey', credentialData, nodeData)
if (selectedChatflowId === options.chatflowid) throw new Error('Cannot call the same chatflow!')
let headers = {}
if (chatflowApiKey) headers = { Authorization: `Bearer ${chatflowApiKey}` }
let toolInput = ''
if (useQuestionFromChat) {
toolInput = input
} else if (customInput) {
toolInput = customInput
}
let name = _name || 'chatflow_tool'View on GitHub (pinned to abe4a8601a)
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.
Example fix
// before
const baseURL = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)
// after
const rawBase = (nodeData.inputs?.baseURL as string) || (options.baseURL as string)
let baseURL = ''
try { baseURL = rawBase ? new URL(rawBase).origin : '' } catch {}
if (!baseURL || !isValidURL(baseURL)) {
throw new Error('Invalid base URL: must be a valid URL')
} Defensive patterns
Strategy: validation
Validate before calling
import { isValidURL } from '../../../src/validator'
function resolveBaseURL(node: INodeData, options: ICommonObject): string {
const raw = (node.inputs?.baseURL as string) || (options.baseURL as string)
const base = raw ? new URL(raw).origin : ''
if (!base || !isValidURL(base)) throw new Error('Invalid base URL: must be a valid URL')
return base
} Type guard
function isAbsoluteUrl(v: unknown): v is string {
if (typeof v !== 'string') return false
try { new URL(v); return true } catch { return false }
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Self-hosted deploy with BASE_URL unset; reverse-proxy scheme mismatch; local dev using 'localhost:3000' instead of 'http://localhost:3000'.
Related errors
- Invalid base URL: must be a valid URL
- Invalid chatflow ID: must be a valid UUID
- Invalid base URL: must be a valid URL
- Model is required
- Invalid Flow State
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/0fdab777e15c883d.
Report an issue: GitHub.