This project is a modified version of Baileys WhatsApp, specifically optimized to run on Cloudflare Workers. It allows you to register multiple WhatsApp numbers and send messages to any number efficiently.
- The system operates directly on the edge, using Cloudflare Workers to establish connections with WhatsApp.
- A direct connection is made with the WhatsApp server WebSocket and maintained for a short period (between 10 and 50 seconds).
- This duration is sufficient to register an account and obtain the key or to send messages.
- After this period, the connection is closed, ensuring efficient resource consumption and significant processing savings.
- Scalability tests have not yet been conducted.
- It is suspected that message sending will be managed through a queue system, rather than horizontal scalability.
This approach aims to keep the system lightweight and efficient without requiring persistent connections.
git clone https://github.com/rafaelsg-01/whatsapp-cloudflare-workers.git
cd whatsapp-cloudflare-workersnpm installwrangler devThe server will be available at: http://127.0.0.1:8787
Choose a name for your UserBot, using only characters from a-z, A-Z and 0-9.
The default admin password is 123456, and it can be changed in the file:
/Example/example.tsIn the variable:
const PASSWORD_ADMIN = "123456";- Access the main page.
- Fill in the
UserBotandAdmin Passwordfields. - Click the blue "Generate QR Code" button.
- Scan the QR Code with WhatsApp on your phone as quickly as possible to avoid errors.
- Wait 30 seconds for the UserBot to appear in the list.
- Go to the Send Message page by clicking the green "Go to Send Message" button.
- Fill in the following fields:
- UserBot (the one you just created)
- Phone number (destination)
- Message
- Admin Password
- Click "Send Message" and if everything is correct, the message will be sent!
This project is also available via npm:
npm i whatsapp-cloudflare-workersIf you have any questions or need help, feel free to open an issue or contribute with improvements!


