The state machine pattern
Your bot tracks each contact’s position in the conversation using a state. The state is a string stored in the database for every contact, and it determines which block of code handles their next message. There are two types of states:- SEND-STATE — sends a message or interactive UI, then transitions the contact into an AWAIT state.
- AWAIT-STATE — receives the user’s response and processes it. It may send a reply and transition to another state, or stay in the same state.
A contact’s state persists across messages. If a contact stops mid-conversation and comes back later, they resume in the same state.
The starter template
When you create a new project, Paige loads a production-ready starter template that handles the plumbing for you. Out of the box it gives you:- A pre-wired webhook handler with the state machine ready to extend
- Helpers for sending every WhatsApp message type
- Helpers for reading and writing your project’s database
- Logging built in for debugging
- A space for AI context documents (knowledge base)
The Code Agent
You build and edit your bot through Paige’s AI chat interface. The Code Agent understands your project’s full codebase and uses a built-in toolset on your behalf — it can read and edit project files, manage the database schema and data, create and publish WhatsApp Flows, and create message templates, all without you leaving the conversation. For details on how to prompt the agent and what it can do, see the Code Agent page.Version history (commits)
Every time you save changes to your bot code, Paige creates a commit. Commits are snapshots of your entire codebase at a point in time.Browse your commit history
Open the Version History panel in the editor to see a list of all commits with timestamps.
Inspect a commit
Click any commit to see what changed — which files were added, modified, or deleted.
Live testing
You can test your bot in real time using Paige Dev — a shared WhatsApp number maintained by Paige. Scan the QR code or open the link from your project dashboard to start a conversation with your bot running the current code. Live testing does not require you to have your own WhatsApp number connected.Message types your bot can send
Your bot can send any of the following message types using built-in messaging helpers:- Plain text
- Interactive buttons (up to 3)
- List menus with sections
- URL buttons
- Images with captions
- Documents (PDF and others)
- Location requests
- Voice notes (with automatic transcription on receipt)
- Message templates
