FlowiseAI/Flowise · error · Error

Tool not selected

Error message

Tool not selected

What it means

Tool_Agentflow.run() requires `selectedTool` — the id of a real component node that implements the tool. When it is falsy (empty/undefined), the node cannot resolve `options.componentNodes[selectedTool]`, so it throws before importing the tool module. This is a configuration error, not a runtime/API failure.

Source

Thrown at packages/components/nodes/agentflow/Tool/Tool.ts:209

        const toolInputArgs = nodeData.inputs?.toolInputArgs as IToolInputArgs[]
        const _toolUpdateState = nodeData.inputs?.toolUpdateState

        const state = options.agentflowRuntime?.state as ICommonObject
        const chatId = options.chatId as string
        const isLastNode = options.isLastNode as boolean
        const isStreamable = isLastNode && options.sseStreamer !== undefined

        const abortController = options.abortController as AbortController

        // Update flow state if needed
        let newState = { ...state }
        if (_toolUpdateState && Array.isArray(_toolUpdateState) && _toolUpdateState.length > 0) {
            newState = updateFlowState(state, _toolUpdateState)
        }

        if (!selectedTool) {
            throw new Error('Tool not selected')
        }

        const nodeInstanceFilePath = options.componentNodes[selectedTool].filePath as string
        const nodeModule = await import(nodeInstanceFilePath)
        const newToolNodeInstance = new nodeModule.nodeClass()
        const newNodeData = {
            ...nodeData,
            credential: selectedToolConfig['FLOWISE_CREDENTIAL_ID'],
            inputs: {
                ...nodeData.inputs,
                ...selectedToolConfig
            }
        }
        const toolInstance = (await newToolNodeInstance.init(newNodeData, '', options)) as Tool | Tool[]

        let toolCallArgs: Record<string, any> = {}

        const parseInputValue = (value: string): any => {

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Open the Tool node and pick a tool from the dropdown / wire a tool component to it.
  2. If bound to a variable, ensure it resolves to an existing componentNodes key at runtime.
  3. Confirm the referenced tool component is still present in the workspace.
  4. Save and re-run the flow.
Defensive patterns

Strategy: validation

Validate before calling

const tool = nodeData.inputs?.selectedTool
if (!tool || !options.componentNodes?.[tool]) {
  throw new Error(`Tool node requires a selectedTool that exists in componentNodes`)
}

Try / catch

try {
  await toolNode.run(nodeData, input, options)
} catch (e) {
  if ((e as Error).message === 'Tool not selected') {
    // open node and pick a tool
  }
  throw e
}

Prevention

When it happens

Trigger: The Tool node's tool-selection input is blank, bound to a variable that resolves to empty, or the selected tool component was deleted/renamed after the flow was saved.

Common situations: Newly dropped Tool node with no tool picked; flow template referencing a custom tool not installed in this workspace; conditional logic sets the tool name to '' at runtime.

Related errors


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