{"slug": "build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes", "title": "Build an AI WhatsApp Customer Service Bot with n8n (No Code, 30 Minutes)", "summary": "A developer built a no-code AI WhatsApp customer service bot using n8n that classifies messages into intents via GPT-4o-mini, handles replies automatically, and escalates urgent issues via Telegram. The workflow costs about $0.46/month for 100 messages per day and can be set up in 30 minutes.", "body_md": "Your WhatsApp Business account receives a message at 11pm. It's a potential client asking about your services. By the time you see it tomorrow morning, they've already bought from a competitor.\n\nThis tutorial shows you how to build a 24/7 AI-powered WhatsApp customer service bot using n8n that:\n\nNo coding required. Setup time: ~30 minutes.\n\nThe workflow has 9 nodes and follows a simple decision tree:\n\n```\nWhatsApp webhook → Parse message → Classify intent (GPT-4o-mini)\n       ↓\n   URGENT? → Yes → Telegram alert + log\n       ↓ No\n   Generate AI reply → Send via WhatsApp API → Log to Sheets → Respond 200\n```\n\nThe OpenAI node classifies each message into one of four intents:\n\n`URGENT`\n\n— complaints, cancellation threats, problems (\"the product arrived broken\")`INFO`\n\n— general questions (\"what are your hours?\", \"do you deliver to Madrid?\")\n`BOOKING`\n\n— appointment requests (\"I'd like to book for Friday at 5pm\")`OTHER`\n\n— anything elseThis is the key logic that decides whether you get woken up or the bot handles it silently.\n\nGo to [developers.facebook.com](https://developers.facebook.com), create an app, add WhatsApp product, and get:\n\n`my_verify_token_2026`\n\n)Set up the webhook to point to your n8n instance:\n\n```\nWebhook URL: https://your-n8n.com/webhook/whatsapp-bot\nSubscribed fields: messages\n```\n\nConfigure as **POST**, path: `whatsapp-bot`\n\n. The webhook also needs to handle GET requests for Meta's verification challenge — add a second route or use an IF node to detect the `hub.challenge`\n\nparameter.\n\nAll settings live in one Code node at the top:\n\n``` js\nconst CONFIG = {\n  // WhatsApp\n  wa_phone_id: \"YOUR_PHONE_NUMBER_ID\",\n  wa_token: \"YOUR_WHATSAPP_ACCESS_TOKEN\",\n\n  // Telegram escalation  \n  telegram_token: \"YOUR_BOT_TOKEN\",\n  telegram_chat_id: \"YOUR_CHAT_ID\",\n\n  // Google Sheets\n  sheet_id: \"YOUR_SPREADSHEET_ID\",\n  gcp_service_account: \"vcWuMisYV6Kfx8Vv\", // your n8n credential ID\n\n  // AI context — this is what makes replies feel personalized\n  business_name: \"Clínica Dental Sánchez\",\n  business_description: \"Clínica dental en Madrid, servicios: limpiezas, ortodoncia, implantes. Horario L-V 9-20h, S 9-14h.\",\n  escalation_keywords: [\"urgente\", \"problema\", \"queja\", \"cancelar\", \"devolver\"],\n  openai_credential_id: \"bC16OOi5YkUp5C10\",\n\n  // Fallback if OpenAI fails\n  fallback_reply: \"Gracias por tu mensaje. Te responderemos lo antes posible en horario laboral.\"\n};\n\nreturn [{ json: CONFIG }];\n```\n\nThe OpenAI node that generates replies uses this prompt structure:\n\n```\nYou are a customer service assistant for {{business_name}}.\n\nBusiness context: {{business_description}}\n\nCustomer message: {{message_text}}\nMessage intent: {{classified_intent}}\n\nReply professionally in the same language as the customer's message. \nKeep it under 3 sentences. Don't make up information not in the business context.\n```\n\nThis is what makes the bot sound like it actually knows your business — not a generic chatbot.\n\nThe HTTP Request node sends back via the Cloud API:\n\n```\nPOST https://graph.facebook.com/v19.0/{{wa_phone_id}}/messages\nAuthorization: Bearer {{wa_token}}\nContent-Type: application/json\n\n{\n  \"messaging_product\": \"whatsapp\",\n  \"to\": \"{{sender_phone}}\",\n  \"type\": \"text\",\n  \"text\": { \"body\": \"{{ai_reply}}\" }\n}\n```\n\n**This is the most important node that most tutorials miss.**\n\nWhatsApp requires your webhook to respond with HTTP 200 within 20 seconds. If it doesn't, Meta marks your webhook as unhealthy and stops sending events.\n\nAdd a **Respond to Webhook** node at the very end of every branch (urgent AND non-urgent) that returns `{\"status\": \"ok\"}`\n\nwith status 200.\n\n**Total for a small business with 100 messages/day: ~$0.46/month in AI costs.**\n\n**Handles well:**\n\n**Needs human review:**\n\nThe Telegram escalation handles the \"needs human review\" bucket automatically.\n\nCustomer sends: *\"Hola, ¿tenéis cita disponible para limpieza este sábado por la mañana?\"*\n\nBot replies (in ~3 seconds): *\"¡Hola! Sí, tenemos citas disponibles los sábados de 9 a 14h. Para reservar, díganos su nombre y el horario preferido y lo gestionamos enseguida.\"*\n\nCustomer sends: *\"El producto que compré llegó roto, exijo una solución AHORA\"*\n\nBot triggers Telegram alert to you: 🚨 **URGENTE** | +34612345678 | \"El producto que compré llegó roto, exijo una solución AHORA\"\n\nYou reply personally. The customer feels heard.\n\nIf you want to skip the manual setup, the complete workflow with all nodes pre-configured is available on [n8nmarkets.com](https://n8nmarkets.com) — search \"WhatsApp Telegram AI Customer Service Agent\".\n\nIt includes the workflow JSON, README with screenshots, and curl commands to test every node before going live.\n\n*Built something similar? Share your setup in the comments — especially if you've handled the webhook verification challenge in a clever way.*", "url": "https://wpnews.pro/news/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes", "canonical_source": "https://dev.to/agoraintelligence/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes-404d", "published_at": "2026-07-26 16:19:17+00:00", "updated_at": "2026-07-26 17:01:14.876715+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-agents", "developer-tools"], "entities": ["n8n", "OpenAI", "GPT-4o-mini", "WhatsApp", "Meta", "Telegram", "Google Sheets"], "alternates": {"html": "https://wpnews.pro/news/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes", "markdown": "https://wpnews.pro/news/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes.md", "text": "https://wpnews.pro/news/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes.txt", "jsonld": "https://wpnews.pro/news/build-an-ai-whatsapp-customer-service-bot-with-n8n-no-code-30-minutes.jsonld"}}