WhatsApp Support Bot with Keyword Routing & GPT Fallback - n8n Workflow

Use this robust n8n workflow to automate WhatsApp customer support. It leverages keyword routing for common FAQs (pricing, support) and employs a LangChain AI Agent powered by GPT-4.1-mini for advanced, dynamic query resolution.

Workflow Preview

Ready to automate?

Download this n8n workflow template and start using it instantly.

Who is this best for?


  • Customer support teams needing 24/7 automation.

  • Businesses using WhatsApp as a primary communication channel.

  • Technical users looking for advanced n8n templates integrating LangChain and AI.

  • Anyone aiming to build scalable, intelligent support systems using n8n.

Overview

Customer service inquiries arriving via WhatsApp often follow predictable patterns. This powerful n8n workflow solves the problem of repetitive query handling by providing rapid, predefined responses for common topics like 'Pricing' or 'Support'. If the incoming message doesn't match a fixed keyword, the n8n flow intelligently routes the query to a sophisticated AI agent using GPT-4.1-mini for dynamic, personalized answers. This saves time, reduces agent load, and ensures instant user response, making this a highly valuable n8n automation solution.

How it Works

This comprehensive n8n workflow starts with the dedicated n8n trigger for WhatsApp, listening for new messages.


  1. Trigger Activation: The WhatsApp Trigger n8n node activates upon receiving a new incoming message.

  2. Greeting Check: The flow first passes through a crucial Check Greeting If n8n node. If the message contains 'hi' or 'hello', a friendly welcome message listing available services is sent immediately via WhatsApp.

  3. Keyword Routing (Pricing): If it's not a greeting, the workflow proceeds to the next If n8n node to check if the user is asking about 'price'. If true, a predefined pricing snippet is sent.

  4. Keyword Routing (Support): Next, the flow checks for the exact keyword 'support'. If found, a message containing support contact details (email and phone) is returned.

  5. AI Fallback: If none of the predefined keywords match, the automation hits the AI fallback path. The text is passed to the LangChain AI Agent n8n node, which utilizes the connected OpenAI Chat Model (configured with gpt-4.1-mini).

  6. Final Delivery: The response generated by the AI agent is captured and delivered back to the user via a final WhatsApp send n8n node. This ensures every message receives a relevant response, whether static or dynamically generated by the AI.

Installation Guide

To deploy this expert n8n workflow, follow these steps:


  1. Import the n8n Workflow: Copy the provided JSON data and paste it into your n8n instance using the 'New' menu and selecting 'Import from JSON'.

  2. Set up Credentials:

WhatsApp Credentials: You must configure credentials for both the WhatsApp Trigger1 node (using the Meta/WhatsApp API for Webhook setup) and the outgoing WhatsApp nodes (for sending messages).
OpenAI Credentials: Set up your API key for the OpenAI Chat Model n8n node.

  1. Configure WhatsApp Parameters: Ensure you update the phoneNumberId in all 'Send' WhatsApp n8n nodes to match your verified WhatsApp Business Account ID.

  2. Activate the n8n Trigger: Once credentials are set, activate the WhatsApp Trigger1 and ensure its webhook is properly registered with Meta (Facebook/WhatsApp).

  3. Activate the Workflow: Set the overall n8n template to 'Active' to start listening for incoming messages.

Node Details


  • WhatsApp Trigger1 (n8n trigger): The starting point. Configured to listen for incoming 'messages' updates on your connected WhatsApp Business account.

  • Check Greeting (If n8n node): Checks if the incoming message body contains 'hi' or 'hello', ignoring case. This is the first decision point in the n8n workflow.

  • If (Pricing Check - n8n node): Checks if the message body contains 'price'. Used for routing to a specific pricing FAQ response.

  • If1 (Support Check - n8n node): Checks if the message body is exactly 'support'. Used for routing to predefined support contact information.

  • OpenAI Chat Model (LangChain n8n node): Configured to use the highly efficient gpt-4.1-mini model. Provides the generative power for the AI agent.

  • AI Agent (LangChain n8n node): Processes the user's raw message text. If no static keyword matches, this n8n node generates a dynamic, relevant answer using the LLM model.

  • WhatsApp (Send message1, etc.): Multiple instances of the WhatsApp n8n node are used to send the predefined or AI-generated textual responses back to the original sender's wa_id.

Related n8n Workflows

Free

Nodes: 6 Nodes
Updated: December 26 2025
View all
Created by

Rahul Joshi is a seasoned technology leader specializing in the n8n automation tool and AI-driven workflow automation. With deep expertise in building open-source workflow automation and self-hosted automation platforms, he helps organizations eliminate manual processes through intelligent n8n ai agent automation solutions.