{"record":{"id":"234a30da492225e6","repo":"FlowiseAI/Flowise","slug":"invalid-agentflow-id-must-be-a-valid-uuid","errorCode":null,"errorMessage":"Invalid agentflow ID: must be a valid UUID","messagePattern":"Invalid agentflow ID: must be a valid UUID","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/AgentAsTool/AgentAsTool.ts","lineNumber":172,"sourceCode":"        const _name = nodeData.inputs?.name as string\n        const description = nodeData.inputs?.description as string\n        const useQuestionFromChat = nodeData.inputs?.useQuestionFromChat as boolean\n        const returnDirect = nodeData.inputs?.returnDirect as boolean\n        const customInput = nodeData.inputs?.customInput as string\n        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","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/AgentAsTool/AgentAsTool.ts#L154-L190","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nconst selectedAgentflowId = nodeData.inputs?.selectedAgentflowId as string\n// after\nconst selectedAgentflowId = nodeData.inputs?.selectedAgentflowId as string\nconst UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\nif (!selectedAgentflowId || !UUID_RE.test(selectedAgentflowId)) {\n  throw new Error('Invalid agentflow ID: must be a valid UUID')\n}","handlingStrategy":"validation","validationCode":"import { isValidUUID } from '../../../src/validator'\nfunction assertAgentflowId(id: string | undefined): asserts id is string {\n  if (!id || !isValidUUID(id)) {\n    throw new Error('Invalid agentflow ID: must be a valid UUID')\n  }\n}","typeGuard":"const UUID_V4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i\nfunction isUuid(v: unknown): v is string {\n  return typeof v === 'string' && UUID_V4.test(v)\n}","tryCatchPattern":null,"preventionTips":["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."],"tags":["validation","uuid","config","agentflow"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}