FlowiseAI/Flowise · error · Error
Invalid agentflow ID: must be a valid UUID
Error message
Invalid agentflow ID: must be a valid UUID
What it means
Thrown in AgentAsTool_Tools.init when selectedAgentflowId is falsy or fails isValidUUID (a regex/format check imported from src/validator). The id must be a canonical UUID because it is used as the path segment in the downstream /api/v1/agentflows/... call. An invalid id would 404 remotely with an opaque message, so validation is done locally first.
Source
Thrown at packages/components/nodes/tools/AgentAsTool/AgentAsTool.ts:172
const _name = nodeData.inputs?.name as string
const description = nodeData.inputs?.description as string
const useQuestionFromChat = nodeData.inputs?.useQuestionFromChat as boolean
const returnDirect = nodeData.inputs?.returnDirect as boolean
const customInput = nodeData.inputs?.customInput as string
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 agentflowid is a valid UUID
if (!selectedAgentflowId || !isValidUUID(selectedAgentflowId)) {
throw new Error('Invalid agentflow 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 agentflowApiKey = getCredentialParam('agentflowApiKey', credentialData, nodeData)
if (selectedAgentflowId === options.chatflowid) throw new Error('Cannot call the same agentflow!')
let headers = {}
if (agentflowApiKey) headers = { Authorization: `Bearer ${agentflowApiKey}` }
let toolInput = ''
if (useQuestionFromChat) {
toolInput = inputView on GitHub (pinned to abe4a8601a)
Solutions
- Re-open the node and select the target agentflow from the dropdown so the UUID is bound correctly.
- If pasting manually, copy the id from the agentflow's URL (the UUID after /agentflows/) in full.
- Ensure the listing endpoint the dropdown uses is reachable (auth, network) so the dropdown populates.
Example fix
// before
const selectedAgentflowId = nodeData.inputs?.selectedAgentflowId as string
// after
const selectedAgentflowId = nodeData.inputs?.selectedAgentflowId as string
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
if (!selectedAgentflowId || !UUID_RE.test(selectedAgentflowId)) {
throw new Error('Invalid agentflow ID: must be a valid UUID')
} Defensive patterns
Strategy: validation
Validate before calling
import { isValidUUID } from '../../../src/validator'
function assertAgentflowId(id: string | undefined): asserts id is string {
if (!id || !isValidUUID(id)) {
throw new Error('Invalid agentflow ID: must be a valid UUID')
}
} Type guard
const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
function isUuid(v: unknown): v is string {
return typeof v === 'string' && UUID_V4.test(v)
} Prevention
- Always select the agentflow from the dropdown rather than typing the id.
- After deleting an agentflow, search flows for stale references to its id.
- When exporting a flow, ensure selectedAgentflowId is preserved verbatim.
When it happens
Trigger: The agentflow dropdown was not populated (no agentflows exist or the API call to list them failed); a flow was exported with the id stripped; the user typed a slug or name instead of copying the UUID.
Common situations: Referencing an agentflow from a different workspace whose UUID was never pasted; agentflow was deleted after the tool was configured; copy-paste truncated the UUID.
Related errors
- Model is required
- Invalid Flow State
- Tool not selected
- Invalid base URL: must be a valid URL
- Invalid chatflow ID: must be a valid UUID
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/234a30da492225e6.
Report an issue: GitHub.