Skip to content

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.

Quick answer: To create a WhatsApp bot, decide what it should do, choose a connection (the official WhatsApp Business Cloud API or a no-code platform), write the replies or connect an AI model, test with your own number, then launch with a human fallback. The software can be free to start, but messages, hosting and AI usage may cost money later.

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.

PathSkill neededTime to launchBest for
No-code builderNoneHoursBusinesses that want it working fast
Automation toolLow1 to 2 daysCustom flows, sheets and CRM links
Own codeMedium to highDays to weeksDevelopers with special needs
Linked-device botLow to mediumMinutesLearning, 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.

  1. Create a Meta developer account and a business portfolio.
  2. Create an app of the business type, then add the WhatsApp product to it.
  3. Use the test number Meta gives you. Add your own phone as an allowed recipient and send a test message.
  4. 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.
  5. Create a permanent access token through a system user, because the temporary token expires quickly.
  6. Add your real number and verify your business when you are ready to go live.
  7. 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:

  1. Add a WhatsApp Trigger node and connect it to your Cloud API app.
  2. Add a Switch node that checks the message text for keywords like "price", "hours" or "book".
  3. For each branch, add a WhatsApp Send node with your prepared answer.
  4. Add a fallback branch that tells the customer a person will reply, and sends you a notification.
  5. 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.

Be aware: Linked-device bots are not an official WhatsApp product. WhatsApp and Meta decide whether an account is restricted or banned, and no bot provider can control that. Use a number you can afford to lose, keep volumes low and message only people who expect to hear from you.

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 person

Test Before You Launch

  1. Send every menu option and check the reply.
  2. Send nonsense, emojis, voice notes and images, and check the bot does not crash.
  3. Ask a friend who has never seen it to use it, and watch where they get stuck.
  4. Check that the handover to a human really notifies someone.
  5. 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

MistakeWhy it hurtsBetter approach
Sending bulk messages to cold contactsComplaints, blocks and bansMessage only people who opted in
No human handoverAngry customers with no way outAlways add an agent option
Long repliesHard to read on a phoneKeep to 2 or 3 short sentences
Using a main personal number for testsYou risk your main accountUse a spare number
Downloading "free premium" bot filesMalware and stolen sessionsUse trusted platforms or code you can read
Never reading logsThe same failures repeatReview 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