Node Details

  • Name: ChatflowTool

  • Type: ChatflowTool

  • Category: Tools

  • Version: 5.0

  • Base Classes: ChatflowTool, Tool

Parameters

Main Parameters

  1. Select Chatflow

    • Type: asyncOptions

    • Description: Allows selection of an existing chatflow to be used as a tool.

  2. Tool Name

    • Type: string

    • Description: Name of the tool, used for identification.

  3. Tool Description

    • Type: string

    • Description: Detailed description of the tool’s functionality, used by the LLM to determine when to use this tool.

  4. Return Direct

    • Type: boolean

    • Optional: Yes

    • Description: Determines if the tool’s output should be returned directly.

Additional Parameters

  1. Override Config

    • Type: json

    • Optional: Yes

    • Description: Allows overriding the configuration passed to the Chatflow.

  2. Base URL

    • Type: string

    • Optional: Yes

    • Default: URL of the incoming request

    • Description: Base URL useful for executing the Chatflow through an alternative route.

  3. Start new session per message

    • Type: boolean

    • Optional: Yes

    • Default: false

    • Description: Determines whether to continue the session with the Chatflow tool or start a new one with each interaction.

  4. Use Question from Chat

    • Type: boolean

    • Optional: Yes

    • Description: If enabled, uses the question from the chat as input to the chatflow, overriding custom input.

  5. Custom Input

    • Type: string

    • Optional: Yes

    • Description: Custom input to be passed to the chatflow. If empty, the LLM decides the input.

Credentials

  • Credential Name: chatflowApi

  • Parameters: chatflowApiKey

Input/Output

  • Input: Depends on the configuration (can be from chat or custom input)

  • Output: String response from the executed chatflow

Functionality

  1. Initializes with selected parameters and credentials.

  2. Creates a ChatflowTool instance with the specified configuration.

  3. When called, it executes the selected chatflow using the provided input.

  4. The tool makes an HTTP POST request to the specified API endpoint.

  5. The response from the executed chatflow is returned as a string.

Use Cases

  • Creating modular chatbots with specialized sub-flows

  • Implementing reusable conversation components

  • Building complex, multi-stage conversational AI systems

  • Integrating different chatflows for varied functionalities within a single conversation

Notes

  • The tool uses a Node.js VM for executing the API call, allowing for secure and isolated execution.

  • It supports both continuation of existing sessions and starting new sessions per interaction.

  • The tool can override configurations, allowing for flexible usage in different contexts.