A complete, enterprise-grade WhatsApp chatbot platform for Frappe, powered by the Pywce core engine.
This app transforms your Frappe/ERPNext instance into a powerful, visual, and high-performance conversational app builder.
Building data-driven WhatsApp bots is hard. They need to be:
- Fast: Respond instantly to high-traffic webhooks.
- Reliable: Process messages in the correct order (FIFO) for each user.
- Stateful: Handle complex, multi-user, authenticated sessions.
- Easy to build: Allow non-technical users to build and edit flows.
frappe-pywce is architected from the ground up to solve all these problems, providing a robust "Conversational App Platform" that lives inside your ERP.
- 🎨 Visual Flow Builder (
pywce-studio): A beautiful, node-based, drag-and-drop canvas (built on ReactFlow) to design complex conversational logic. - 📱 High-Fidelity Emulator (
pywce-preview): The killer feature. A local, high-fidelity WhatsApp simulator. It runs your entire engine, generates real payloads, and fires your real webhook logic, all 100% on your local machine. No phone, no public server, no "code-deploy-test" loop. - ⚡ High-Performance Backend: Built for scale. Webhooks are handled asynchronously using
frappe.enqueue. Your API responds instantly while background workers do the heavy lifting. - 🔒 Guaranteed FIFO & Concurrency: Handles 500+ concurrent users. A robust Redis locking system ensures that while different users are processed in parallel, messages from a single user are processed serially (FIFO), preventing broken conversations.
- 🔑 Secure Auth & Session Management: Instantly and securely resumes a full Frappe user session from a WhatsApp request, whether through an in-chat WA Flow login or a secure link.
- 🔗 Live ERP Data: Securely pull live data as the authenticated user. A message like
"Hi {{ doc.first_name }}, your order {{ doc.name }} is now {{ doc.status }_"just works using a powerful hook template mechanis,.
Install the app to your bench:
$ bench get-app frappe_pywce https://github.com/DonnC/frappe_pywce.git
$ bench --site <your-site-name> install-app frappe_pywceAfter installing, go to your Frappe Desk:
- Search for
ChatBot Configin the AwesomeBar. - Enter your WhatsApp Business API
Access Token,Phone ID, andWebhook Token. - Configure your desired settings
Although you target to use Local emulator, you may put dummy required WhatsApp Settings.
- Go to (or on the config doctype) the
ChatBot ConfigDocType. - Click the "Open Builder" button to be taken to the
pywce-studiovisual editor for this flow. - To test locally, set the environment to
local. A button will appear to launch the emulator.
To launch emulator, ensure you followed the
Development Setupbelow
For contributing or running the UI locally with hot-reloading:
-
Start the Frappe Backend: In your bench directory, run:
$ bench start
-
Start the UI Dev Server: In a second terminal, navigate to the app folder and start the Vite dev server:
$ cd apps/frappe_pywce $ yarn dev
This will launch the Vite server (usually on localhost:8080) which hot-reloads as you make changes and proxies all backend requests to your Frappe server.
- Builder UI:
http://localhost:8080/bot/studio - Emulator UI:
http://localhost:8081/bot/emulator
-
Quick start You can quickly setup a bot by importing an eHailing chatbot and test it locally or build from there
Check the example folder here
To build the UI assets for production, run this single command:
$ bench build --app frappe_pywceThis will bundle the React UIs, and they will be accessible at http://your-frappe-site.com/bot/studio.
Need a ChatBot for your business or next project! or just to say Hello - Let's get in touch via email
Visit the official wce documentation for a detailed guide.
We welcome contributions! Please check out the Contributing Guide for details.
The UIs where largely vibe-coded using Lovable (React)
This project is licensed under the MIT License. See the LICENSE file for details.

