Creating a WhatsApp Chatbot with AI
A Step-by-Step Guide


Creating a WhatsApp Chatbot with AI: A Step-by-Step Guide
In this guide, I’ll walk you through building a fully functional WhatsApp chatbot using AI, designed to handle customer queries, product recommendations, order tracking, and more—all without coding. My name is Yashika Jain, founder of Automates AI, an agency specializing in AI automation solutions, including WhatsApp chatbots. Let’s dive into the process with a live demo and setup instructions.
Demo: Key Features in Action
Let’s start with a simple interaction. I greeted the chatbot, and it responded as Zara, the AI assistant from ShopEase, offering help with orders, gifts, or questions. Here’s how it performed:
1. Return and Refund Policy
Query: "What is your return and refund policy?"
Response: Returns are accepted within 30 days for unused items in original packaging, with refunds processed in 5-7 business days. This matches the uploaded knowledge base perfectly.
2. Product Recommendations
Query: "I want to buy a gift for my sister."
Follow-up: Occasion (birthday), budget (<$20), preference (customized gifts).
Response: Suggested a leather journal, customized t-shirt, and personalized coffee mug—all under $20 and in stock. The bot filtered these from a product database based on my inputs.
3. Order Tracking
Query: "I ordered a coffee mug last Saturday. When can I expect it to arrive?" (with order ID).
Response: Delivery expected by January 3rd (noted as an old database error; should be 2025). This was pulled from the order log database.
Additional Features
Ticket Creation: For wrong orders, the bot can collect details (name, email, issue) and escalate to the team.
Appointments: Ideal for businesses needing scheduling, rescheduling, or cancellations.
Why Build This Chatbot?
WhatsApp chatbots are trending for customer engagement. As an AI consultant, I’ve deployed these for various businesses, and this no-code solution using N8N and Twilio makes it accessible for anyone.
Tools You’ll Need
N8N: A no-code automation platform (free trial available via my affiliate link in the description).
Twilio: For WhatsApp capabilities (free credits included; buy a number for ~$1.15/month during trial).
Step-by-Step Setup
1. Set Up Twilio
Create an account at Twilio.com (link in description).
Search “buy a number,” select your country, and purchase a number (deducted from free credits).
Search “WhatsApp” > “WhatsApp Senders” > “Create New Sender.”
Link the bought number, connect a WhatsApp Business account via Facebook (requires a basic Facebook account), and verify with an OTP from Twilio.
Wait for the status to turn “online” (up to 10 minutes).
2. Configure N8N Automation
Sign up at N8N (link in description) and create a new workflow.
Trigger: Add a Twilio “On New SMS” trigger (covers WhatsApp messages). Connect your Twilio account using SID and Auth Token from the Twilio dashboard.
Test Trigger: Send a “hi” via WhatsApp to your Twilio number and verify it’s caught in N8N.
3. Integrate OpenAI
Go to OpenAI.com > API platform > create an account > generate an API key.
In N8N, add an “OpenAI” node > “Message and Assistant” > paste the API key.
Create an assistant in OpenAI (e.g., “ShopEase WhatsApp Agent”) with a system prompt (downloadable in resources) defining identity, conversational flow (e.g., general queries, order tracking, product suggestions), and guidelines.
Upload knowledge base files (e.g., ShopEase FAQs PDF) via “File Search” for accurate responses.
4. Enable Memory
Add a “Simple Memory” node in N8N, using the sender’s number as a key to remember past 10 messages for context.
5. Send Responses
Add a Twilio “Send SMS” node, set “From” and “To” as dynamic expressions (in resources), toggle “To WhatsApp,” and link the OpenAI output as the message.
Test by executing the workflow and checking the WhatsApp response.
6. Add Tools for Advanced Features
Inventory Lookup: Duplicate the node, connect to Airtable (or your database), select “Inventory” table, and use AI to filter products (e.g., price ≤ $20).
Order Tracking: Duplicate again, select “Order Logs” table, filter by order ID.
Ticket Creation: Duplicate, select “Create” operation, use “Tickets” table, let AI fill name, email, and issue.
Update the prompt with tool names (e.g., “inventoryLookup,” “orderTracking,” “createTicket”).
7. Clean Responses
Add a “Code Tool” node with JavaScript to remove annotations (e.g., file references) from responses (code in resources).
Update the prompt to run “removeAnnotations” before replying.
8. Finalize and Test
Rename the workflow (e.g., “WhatsApp Bot YouTube”), turn on automation, and test each feature (e.g., refund policy, product suggestions).
Check executions in N8N for backend insights.
Customization Tips
Replace Airtable with your own software (e.g., Shopify, Google Calendar) by adding relevant nodes.
Adjust the prompt based on testing to refine responses.
Resources
Prompt, expressions, Airtable database link, and code in the description.
Connect with me on LinkedIn or explore Automates AI services via the website links below.
Conclusion
You now have a WhatsApp chatbot capable of handling queries, recommendations, and more. Let me know in the comments if it’s working or if you need help. I’ll see you in the next video—bye!
© 2025. All rights reserved.
Email : dreamface@newportalai.com
Ai Tool
Product
Company
Follow Us
Try on Desktop
Avater Video
Ai Video
Ai Photo

