How to Create a WhatsApp Bot: A Beginner Guide for Free and Paid Setups
By Erfan Ahmed, founder of Erfan MD · Updated October 2026
You can create a WhatsApp bot in an afternoon if you pick the right path. This guide explains how to make a WhatsApp bot with a no-code builder, an automation tool such as n8n, or a little Python, what each path costs, how to test it, and which mistakes cause bans and bad customer experiences. It is written for beginners, small business owners and developers who want a clear starting point.
Before You Build: Decide What the Bot Should Do
Most failed bots fail because the goal was vague. "Answer customers" is not a goal. "Reply to the five questions we get every day, take a booking request, and pass anything else to a person" is. Write down three things before you touch any tool:
- The job: support, bookings, order updates, lead capture, reminders or a group helper.
- The questions: list the 10 most common messages you receive and the correct answer to each.
- The handover: decide when a person takes over, such as complaints, refunds or anything the bot cannot answer.
This list becomes your bot. Whether you use a builder or code, the same list drives every reply.
Four Ways to Build a WhatsApp Bot
No-code builder
Visual tools such as Wati, Gupshup, ManyChat or Zoho SalesIQ. Fastest, but with monthly fees.
Automation tool
n8n, Zapier or Make connect WhatsApp to sheets, CRMs and AI with blocks.
Your own code
Python or Node.js with the Cloud API. Most control, most maintenance.
Linked-device bot
Pairs like WhatsApp Web. Quick, but unofficial, with ban risk.
| Path | Skill needed | Time to launch | Best for |
|---|---|---|---|
| No-code builder | None | Hours | Businesses that want it working fast |
| Automation tool | Low | 1 to 2 days | Custom flows, sheets and CRM links |
| Own code | Medium to high | Days to weeks | Developers with special needs |
| Linked-device bot | Low to medium | Minutes | Learning, groups, personal use |
Is It Free to Create a WhatsApp Bot?
Creating a bot can be free, but running one for customers rarely is. Meta lets you register and use test numbers without paying. Costs appear when you send business-started template messages, use AI model credits, outgrow a free automation plan or need steady hosting. Replies sent inside the 24-hour customer service window are generally not charged, but rates change, so check Meta's current pricing before you plan your budget.
If you only want to learn how to build a WhatsApp bot, free tiers are enough. Treat any site promising an unlimited free bot with caution, since the limit usually shows up later as a ban, a watermark or a stolen session.
Method 1: Create a WhatsApp Bot With the Official Cloud API
This is the route for any business that talks to customers. The steps below are the usual order, though Meta's screens change, so follow its current documentation as you go.
- Create a Meta developer account and a business portfolio.
- Create an app of the business type, then add the WhatsApp product to it.
- Use the test number Meta gives you. Add your own phone as an allowed recipient and send a test message.
- Set up a webhook. This is a web address on your server that Meta calls whenever a customer writes. Add a verify token you choose, then subscribe to the messages field.
- Create a permanent access token through a system user, because the temporary token expires quickly.
- Add your real number and verify your business when you are ready to go live.
- Submit message templates for any messages you need to send outside the 24-hour window.
Once the webhook works, the bot is just code or a workflow that decides what to send back.
Method 2: Make a WhatsApp Bot With n8n or Zapier
If the webhook step sounds heavy, an automation tool handles it for you. In n8n, the flow is short:
- Add a WhatsApp Trigger node and connect it to your Cloud API app.
- Add a Switch node that checks the message text for keywords like "price", "hours" or "book".
- For each branch, add a WhatsApp Send node with your prepared answer.
- Add a fallback branch that tells the customer a person will reply, and sends you a notification.
- Optionally add an AI node for open questions. Our ChatGPT WhatsApp bot guide shows how.
The same logic works in Zapier or Make. You can also save every message to Google Sheets, which gives you a free log of what customers ask.
Method 3: Build a WhatsApp Bot With Python
For developers, a bot is a small web app. Here is the core of a Flask webhook that echoes a reply. It shows the structure, and you would add your own logic and error handling:
from flask import Flask, request
import os, requests
app = Flask(__name__)
VERIFY = os.environ["VERIFY_TOKEN"]
TOKEN = os.environ["WA_TOKEN"]
PHONE_ID = os.environ["WA_PHONE_ID"]
GRAPH = "v21.0" # use the current version from Meta's docs
@app.get("/webhook")
def verify():
if request.args.get("hub.verify_token") == VERIFY:
return request.args.get("hub.challenge")
return "forbidden", 403
@app.post("/webhook")
def incoming():
data = request.get_json()
try:
msg = data["entry"][0]["changes"][0]["value"]["messages"][0]
reply(msg["from"], "Thanks! We will reply shortly.")
except (KeyError, IndexError):
pass
return "ok", 200
def reply(to, text):
url = f"https://graph.facebook.com/{GRAPH}/{PHONE_ID}/messages"
requests.post(url, headers={"Authorization": f"Bearer {TOKEN}"},
json={"messaging_product": "whatsapp", "to": to,
"type": "text", "text": {"body": text}})Keep tokens in environment variables, never in the code. For Node.js, the structure is the same: a webhook route and a function that posts to the messages endpoint. Our deployment guide covers where to host it.
Method 4: Linked-Device Bots and the Pair Code
Community bots work by pairing with your number the way WhatsApp Web does. You choose a server, enter your number, get a pairing code, then open WhatsApp, go to Linked Devices, choose Link a Device, and enter the code. Erfan MD uses this flow. It is quick, needs no developer account and works for automating replies, broadcasts and follow-ups to your contacts.
Design the Conversation
A bot that answers well is mostly good writing. Follow these rules:
- Greet and offer choices. A short menu of three or four options beats an open question.
- Write like a person. One or two short sentences, in the customer's language.
- Confirm actions. After a booking or order, repeat the details back.
- Admit limits. If the bot does not know, say so and offer a human.
- Offer an exit. Let customers type "agent" or "0" at any time.
Example menu
Hi! I'm the assistant for [Business].
Reply with a number:
1 - Prices and services
2 - Opening hours and location
3 - Book an appointment
0 - Talk to a personTest Before You Launch
- Send every menu option and check the reply.
- Send nonsense, emojis, voice notes and images, and check the bot does not crash.
- Ask a friend who has never seen it to use it, and watch where they get stuck.
- Check that the handover to a human really notifies someone.
- Confirm replies work outside business hours, since that is when bots matter most.
Launch Checklist
- Customers know they are talking to an automated assistant.
- You have consent to message people, and "stop" requests are honored.
- Someone reads the handover alerts every day.
- Tokens and passwords are stored safely and are not shared.
- You have a backup plan if the server or number goes down.
Common Mistakes When You Make a WhatsApp Bot
| Mistake | Why it hurts | Better approach |
|---|---|---|
| Sending bulk messages to cold contacts | Complaints, blocks and bans | Message only people who opted in |
| No human handover | Angry customers with no way out | Always add an agent option |
| Long replies | Hard to read on a phone | Keep to 2 or 3 short sentences |
| Using a main personal number for tests | You risk your main account | Use a spare number |
| Downloading "free premium" bot files | Malware and stolen sessions | Use trusted platforms or code you can read |
| Never reading logs | The same failures repeat | Review chats weekly and improve replies |
How to Get and Use a WhatsApp Bot Someone Else Built
If you only want to use a bot, not build one, the steps are simpler. Find the bot's number or pairing page on its official website, never from a random group post. If it is a service like Erfan MD, follow the pairing steps above. Start with a harmless command such as a menu, check what it asks for, and never share passwords or payment details in a chat with any bot.
Which Path Should You Choose?
- Customer-facing business, no developer: a no-code builder or n8n with the Cloud API.
- Developer with special needs: custom Python or Node.js with the Cloud API.
- Quick experiment or group helper: a linked-device bot on a spare number.
- Want an AI assistant: add a model to any of the above.
Related guides: ChatGPT WhatsApp bot, n8n WhatsApp bot, API pricing and WhatsApp bot for business.
Frequently Asked Questions
Can I create a WhatsApp bot for free?
You can build and test one for free. Running it for real customers usually adds message, hosting or AI costs.
Can you make a WhatsApp bot without coding?
Yes. No-code builders and automation tools like n8n let you build one with blocks.
How long does it take to build a WhatsApp bot?
A simple menu bot can take hours on a builder. Custom code or business verification can take days or weeks.
Do I need a separate phone number?
For the official API, a number that is not already in use on the regular WhatsApp app is needed. For linked-device bots, a spare number protects your main account.
Is it legal to make a WhatsApp bot?
Using the official API within Meta's terms is allowed. Unofficial bots may breach WhatsApp's terms, and spam or privacy laws still apply wherever you operate.
Skip the setup with Erfan MD
Pick a server, enter your number, link it with a pairing code, and start automating replies, broadcasts and follow-ups.
Explore Erfan MD