Skip to main content

Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration

Workflow preview

Workflow preview
100%
Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Full Customer Support WhatsApp AI Bot (Self Hosted, Evolution API) ‍ Who’s it for This template is for businesses using WhatsApp for customer communication who want to automate support using AI...

Best for

  • Support Chatbot automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.switch, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.outputparserstructured, n8n-nodes-base.httprequesttool, n8n-nodes-base.webhook, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Ahmed Saadawi.

Original n8n.io source

1.1 Workflow description

Title
Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration
Workflow name
Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration

Full Customer Support WhatsApp AI Bot (Self-Hosted, Evolution API)

🧑‍💼 Who’s it for

This template is for businesses using WhatsApp for customer communication who want to automate support using AI and real-time CRM data — especially in retail, food & beverage, e-commerce, or service sectors. It’s ideal for self-hosted n8n users with access to OpenAI and a CRM with API endpoints.


💡 What It Does

This workflow creates a multi-intent AI chatbot that handles WhatsApp conversations and connects to your CRM using HTTP APIs. It uses LangChain’s AI Agent to dynamically classify and respond to customer queries in real time.

🔄 Supported Use Cases:

  • 📍 Branch inquiries (nearest location, hours, contact)
  • 🍰 Menu & product info (availability, categories, images)
  • 🛒 Order creation & tracking
  • ⚠️ Complaint submission and follow-up
  • ⭐ Loyalty points lookup
  • ✨ Concierge & custom orders

Each user message is routed using AI to the appropriate path, where a tailored system prompt and real-time API call generate a smart, emoji-rich reply.


🚀 Key Advantages

  • Plug-and-play AI support bot with 6 distinct customer intents
  • No code logic building — uses natural language instructions via LangChain
  • Connects to your CRM using httpRequestTool nodes
  • Smart classification with OpenAI (via LangChain agent)
  • Sticky notes and prompt modularity for easy customization
  • Real-time replies using dynamic data from your API
  • Short, branded, emoji-friendly replies with support for Arabic NLP patterns

🔧 How It Works

  1. 🧲 A Webhook (via evolution-api node) receives incoming WhatsApp messages.
  2. 🧠 An AI Router Agent classifies the message intent using GPT-4.
  3. 🧰 Based on the intent, a specific system prompt is injected.
  4. 🧠 A LangChain Agent uses tools (CRM APIs) to fetch data.
  5. 💬 A final reply is generated and sent back via WhatsApp.

Everything is modular, explainable, and built with clarity in mind using sticky notes and renamed nodes.


🛠️ Requirements

  • ✅ Self-hosted n8n (required for community nodes)

  • evolution-api node (for WhatsApp messaging)

  • ✅ OpenAI API Key

  • ✅ Your own CRM HTTP API endpoints for:

    • Order creation/status
    • Menu & category lookup
    • Complaints
    • Branch search
    • Loyalty points

⚙️ Setup Instructions

  1. 🔌 Install the evolution-api node via n8n community nodes.
  2. 🔐 Replace all YOUR_AUTHORIZATION_TOKEN_HERE with your real credentials.
  3. 🧠 Add your OpenAI credentials in n8n.
  4. 🛠️ Update all CRM URLs to point to your environment.
  5. 📲 Connect the webhook URL to your WhatsApp provider.

🎨 How to Customize

  • Edit the intent categories in the AI router prompt.
  • Modify each system prompt for tone, brand, or language (supports Arabic).
  • Add more tools or branches (e.g., shipping, feedback, upselling).
  • Use n8n’s credentials manager for production security.

🧠 User Experience & Design

  • Sticky notes provide full visual explanation of logic.
  • Prompts ensure short, relevant, context-aware replies.
  • User session memory improves continuity across messages.
  • Optimized for performance and ease of onboarding.

🔍 SEO Tags

whatsapp support bot, n8n chatbot, gpt-4 ai support, langchain agent, self-hosted n8n, crm integration, customer support automation, evolution-api, loyalty bot, menu chatbot, orders automation, arabic whatsapp bot, real-time crm bot, openai n8n workflow

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Switch

Type / Role
n8n-nodes-base.switch - switch
Config choices
Version 3.2

Block 2 - Orders System Prompt

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 3 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.1

Block 4 - OpenAI Chat Model1

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 5 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 6 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.3

Block 7 - OpenAI Chat Model2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 8 - Branches System Prompt

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Menu System Prompt

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Complaints System Prompt

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 11 - crm_search_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 12 - save_crm_record_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 13 - get_loyalty_points_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 14 - items_search_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 15 - branches_search_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 16 - categories_search_tool

Type / Role
n8n-nodes-base.httpRequestTool - httpRequestTool
Config choices
Version 4.2

Block 17 - Webhook: Receive WhatsApp message

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2.1

Block 18 - AI Agent Router: Classify msg

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 2.2

Block 19 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Simple Memory-2

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 21 - Simple Memory

Type / Role
@n8n/n8n-nodes-langchain.memoryBufferWindow - memoryBufferWindow
Config choices
Version 1.3

Block 22 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 23 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 24 - Send WhatsApp Greeting

Type / Role
n8n-nodes-evolution-api.evolutionApi - evolutionApi
Config choices
Version 1

Showing the first 24 of 26 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration
Complexity advanced
Nodes 26
Categories Support Chatbot, AI Chatbot
Author Ahmed Saadawi
Published 05 Sept 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8297/8297.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Build a WhatsApp customer support bot with LangChain, OpenAI, and CRM integration do?

Full Customer Support WhatsApp AI Bot (Self Hosted, Evolution API) ‍ Who’s it for This template is for businesses using WhatsApp for customer communication who want to automate support using AI...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Support Chatbot, AI Chatbot use case.