FlowiseAI/Flowise · error · Error

Cannot call the same chatflow!

Error message

Cannot call the same chatflow!

What it means

Thrown when selectedChatflowId equals options.chatflowid — the chatflow-as-tool would invoke the very chatflow currently running. Same recursion guard as error 346 for the agentflow variant: prevents an infinite HTTP self-call loop.

Source

Thrown at packages/components/nodes/tools/ChatflowTool/ChatflowTool.ts:191

        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'

        return new ChatflowTool({
            name,
            baseURL,
            description,
            returnDirect,

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Select a different chatflow as the tool target.
  2. If self-invocation is truly needed, call the internal logic directly instead of via HTTP.
  3. Filter the dropdown so the host flow's own id is not selectable.

Example fix

// before
if (selectedChatflowId === options.chatflowid) throw new Error('Cannot call the same chatflow!')
// after
if (selectedChatflowId === options.chatflowid) {
  throw new Error(`Cannot call the same chatflow (id=${selectedChatflowId}). Pick a different target chatflow.`)
}
Defensive patterns

Strategy: validation

Validate before calling

function assertNotSelfCallChatflow(targetId: string, hostId: string | undefined) {
  if (targetId === hostId) {
    throw new Error(`Cannot call the same chatflow (id=${targetId}). Pick a different target.`)
  }
}

Prevention

When it happens

Trigger: A ChatflowTool node pointed at its own chatflow id; dynamic config that resolves to the host id; flow duplicated as a template without retargeting.

Common situations: Building an orchestrator chatflow that mistakenly lists itself; copy-paste of tool config across flows without updating the target.

Related errors


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