العودة إلى المدونة
WhatsAppChatbotn8nAutomationNo-Code

How to Automate a WhatsApp Chatbot with n8n (No-Code Guide)

212AY Team·2026-05-16·13 min

WhatsApp is the #1 messaging app in Morocco and across Africa. If your business isn't on WhatsApp, you're invisible. And if you're answering every message manually, you're burning hours that AI could handle. Here's how to build an AI-powered WhatsApp chatbot using n8n — no coding required.

Why WhatsApp Automation Matters

The numbers speak for themselves:

  • 93% of Moroccans use WhatsApp daily
  • Businesses lose 67% of leads that aren't responded to within 5 minutes
  • AI chatbots reduce support costs by up to 80%

What You'll Build

By the end of this guide, you'll have a WhatsApp chatbot that:

  • Responds to customer messages instantly, 24/7
  • Answers FAQs using AI (powered by OpenAI)
  • Captures leads and saves them to Google Sheets
  • Escalates complex questions to a human

Prerequisites

  • n8n account (free self-hosted or cloud plan)
  • WhatsApp Business API access (via Twilio or Meta Business)
  • OpenAI API key
  • Google Sheets (for lead storage)

Step 1: Set Up WhatsApp Business API

Option A: Twilio (Easier)

  1. Create a Twilio account
  2. Enable WhatsApp Sandbox for testing
  3. Get your Account SID and Auth Token
  4. Option B: Meta Business API (Production)

    1. Create a Meta Business account
    2. Set up WhatsApp Business API
    3. Get your access token and phone number ID
    4. Step 2: Create the n8n Workflow

      Trigger: WhatsApp Message Received

      1. Add a "Webhook" trigger node
      2. Configure it to receive POST requests
      3. Set your WhatsApp provider to send messages to this webhook URL
      4. Process: AI Response Generation

        1. Add an "OpenAI" node
        2. Configure it with your API key
        3. Set the system prompt:
        4. ~~~

          You are a helpful customer support assistant for [Your Business].

          Answer questions about our products, pricing, and services.

          If you don't know the answer, say "Let me connect you with our team"

          and set escalate=true in your response.

          Always respond in the customer's language (Arabic, French, or English).

          ~~~

          Action: Send Response via WhatsApp

          1. Add an "HTTP Request" node
          2. Configure it to send the AI response back via WhatsApp API
          3. Save Lead: Google Sheets

            1. Add a "Google Sheets" node
            2. Save new contact name, phone, first message, and timestamp
            3. Step 3: Add Smart Features

              FAQ Knowledge Base

              Create a Google Doc with your FAQs. Add a "Google Docs" node to retrieve this context before the AI node. This gives the AI accurate information about your specific business.

              Language Detection

              WhatsApp messages from Morocco come in Arabic, French, Darija, and English. Add a step that detects language and instructs the AI to respond in the same language.

              Business Hours Logic

              Add an "If" node to check if it's business hours. During hours, let the AI respond and notify your team. After hours, let the AI handle everything autonomously.

              Step 4: Test and Deploy

              1. Send test messages to your WhatsApp number
              2. Verify AI responses are accurate and helpful
              3. Check that leads are being saved correctly
              4. Test the escalation flow
              5. Real Results

                Businesses using this setup report:

                • 3x faster response times
                • 60% reduction in support workload
                • 25% increase in lead conversion (faster responses = more sales)

                Learn to Build This and More

                212AY's AI Automation & Tools programme teaches you to build sophisticated automation workflows like this in 6 weeks. You'll master n8n, Make, and AI integration — skills that are in massive demand.

أحدث المقالات

أتمتة الذكاء الاصطناعي 101: بناء سير العمل باستخدام n8n و Make

اكتشف كيفية بناء أتمتات قوية مدعومة بالذكاء الاصطناعي باستخدام n8n و Make. من دون كود إلى محترف، تعلّم الأدوات التي تعيد تشكيل مشهد الأتمتة.

بناء أول سير عمل أتمتة بالذكاء الاصطناعي باستخدام n8n

دليل عملي كامل لبناء سير عمل أتمتة مدعوم بالذكاء الاصطناعي باستخدام n8n، من ربط واجهات API إلى النشر في الإنتاج.

AI for Entrepreneurs in Morocco: Build Smarter, Scale Faster

How Moroccan entrepreneurs can leverage AI to automate operations, reduce costs, and build competitive products. Practical strategies with real examples.