Chatbot AI

Chatbot AI automates user interactions on the Line platform, providing real-time responses through a seamless integration with LangChain. It efficiently handles text messages, offers cognitive behavioral therapy (CBT) support, and informs users when non-text inputs are not supported. This workflow enhances user engagement by displaying loading animations while processing requests, ensuring users feel attended to without delays.

7/8/2025
14 nodes
Medium
webhookmediumlangchainsticky noteadvancedapiintegrationlogicconditional
Categories:
Webhook TriggeredMedium Workflow
Integrations:
LangChainSticky Note

Target Audience

This workflow is ideal for:
- Mental Health Professionals: Therapists looking to integrate automated responses into their practice.
- Developers: Those interested in creating chatbots for mental health support using LangChain and n8n.
- Organizations: Institutions aiming to provide timely responses to users seeking CBT therapy.
- Tech Enthusiasts: Individuals wanting to learn about integrating APIs and automation in mental health services.

Problem Solved

This workflow addresses the challenge of providing immediate support and responses to users seeking cognitive behavioral therapy (CBT) through a chatbot interface. It ensures that users receive timely and relevant information, while also managing unsupported input types effectively.

Workflow Steps

  • Webhook Trigger: The workflow is initiated when a user sends a message to the chatbot on LINE.
    2. Loading Animation: A loading animation is triggered to inform the user that their request is being processed.
    3. Check Message Type: The workflow checks if the incoming message is of type text. If not, it responds with a message stating that other input types are not supported.
    4. AI Agent Processing: If the message is text, it is passed to an AI Agent, which uses a defined system message to provide CBT-related responses.
    5. Format Reply: The response from the AI Agent is formatted to ensure it is suitable for sending back to the user.
    6. Reply to User: Finally, the formatted response is sent back to the user on LINE, providing them with the necessary support.
  • Customization Guide

    Users can customize this workflow by:
    - Modifying the AI Agent's System Message: Adjust the content of the system message to change the tone or focus of the chatbot's responses.
    - Changing the Loading Animation Duration: Update the loadingSeconds parameter in the Loading Animation node to modify how long the loading animation displays.
    - Editing Response Messages: Customize the text messages sent in the ReplyMessage - Not supported node to better fit the organization's voice.
    - Adding Additional Nodes: Integrate more nodes to enhance functionality, such as connecting to databases for user data or adding more complex logic for different types of user inputs.