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 = input

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Re-open the node and select the target agentflow from the dropdown so the UUID is bound correctly.
  2. If pasting manually, copy the id from the agentflow's URL (the UUID after /agentflows/) in full.
  3. 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

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


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/234a30da492225e6. Report an issue: GitHub.