Chatbots
Build automated conversation flows that respond 24/7 — handle FAQs, collect leads, qualify prospects, and route to agents.
How Chatbots Work
A chatbot is a visual flow: when a contact sends a message matching a trigger, MotherBot runs the connected node sequence automatically — no agent required.- Multiple chatbots can be active simultaneously on the same number.
- The highest-priority matching chatbot wins when triggers overlap.
- Variables let you store data collected during the conversation and reuse it in later nodes.
- Contact fields (name, phone, email, and custom fields) are available automatically — no setup needed.
- Hand off to a human agent at any point in the flow.
Creating a Chatbot
1
Open Chatbots → New Chatbot
Click New Chatbot, give it a name and optional description. A name like "Lead Capture — EN" helps manage multiple bots.
2
Set a trigger
Choose when the chatbot activates:
| Trigger | When it fires |
|---|---|
| Keyword Match | Contact's message contains a specific word or phrase (e.g. "pricing", "hi"). |
| Exact Match | Contact's message exactly equals the keyword (case-insensitive). |
| Any Message | Fires on every incoming message — use with high priority or specific conditions. |
| Session Start | First time a contact ever messages your number (great for welcome messages). |
| Regex Pattern | Advanced: fires when the message matches a regular expression. |
3
Build the node sequence
Add nodes from the sidebar and connect them. Each node executes in order when the flow reaches it.
Available Node Types
| Node | Description |
|---|---|
| Send Message | Send a free-text or rich-media reply within the 24h session window. |
| Send Template | Send a Meta-approved template — works outside the 24h window. |
| Ask Question | Send a prompt and wait for the contact's reply, saving it to a variable. |
| Condition / If | Branch the flow based on variable values, contact fields, or custom field values. |
| Set Variable | Store a static value or formula result into a named variable. |
| HTTP Request | Call an external API and map response fields to variables. |
| Add / Remove Tag | Tag or untag the contact for segmentation. |
| Update Contact | Write a collected value back to a contact field or custom field. |
| Assign to Agent | Transfer the conversation to the next available agent. |
| End Conversation | Close the chatbot session (contact can re-trigger by messaging again). |
| Delay | Wait N seconds before the next node executes. |
| AI Reply | Generate a response using your configured AI provider (OpenAI, Gemini, etc.). |
Variables Reference
Variables use double-brace syntax in any message, question, or condition text. Contact fields are pre-populated automatically at the start of every chatbot session — you don't need an "Ask Question" node to access them.── Contact fields (always available) ───────────────────
{{contact_name}} Contact's display name
{{contact_phone}} Phone number (E.164 format, e.g. +12125551234)
{{contact_email}} Email address (empty string if not set)
── Custom fields (cf1–cf10, if defined in Contacts → Custom Fields) ──
{{cf1}} Value of your first custom field (e.g. Company Name)
{{cf2}} Value of your second custom field (e.g. Invoice Number)
... up to {{cf10}}
── Session variables (set during this conversation) ───
{{order_id}} Set via "Set Variable" or "Ask Question" node
{{city}} Captured via "Ask Question"
{{api_price}} Extracted from an HTTP Request response
── System variables ────────────────────────────────────
{{org_id}} Your organization ID (useful in HTTP Request URLs)Tip
Custom field values reflect what's stored on the contact at the time the chatbot session starts. If you update a custom field mid-session via "Update Contact", the variable updates immediately and subsequent nodes see the new value.
Collecting and Saving Data
1
Ask Question node
Send a prompt and store the contact's next reply in a variable name you choose. Set the input type (free text, number, email, phone, date) — invalid replies trigger a retry message.
2
Writing back to contact fields
After collecting a value, add an Update Contact node to persist it — for example, saving a collected company name to cf1 so it's available in future sessions and campaigns.
3
HTTP Request → variable mapping
After calling an external API, map JSON response paths to variables:
Response: { "order": { "status": "shipped", "eta": "June 20" } }
Map:
order.status → {{order_status}}
order.eta → {{delivery_date}}Then use {{order_status}} in a Send Message node: "Your order is {{order_status}}, arriving {{delivery_date}}."Priority and Conflict Resolution
If two chatbots have overlapping triggers, the one with the lower priority number wins. Set priority in the chatbot settings panel. Recommended ordering:- Priority 1 — Opt-out / STOP handler (always highest priority)
- Priority 2 — Session start / Welcome bot
- Priority 3–9 — Feature-specific bots (pricing, support, order lookup, etc.)
- Priority 10+ — Catch-all / fallback bot
Testing Your Chatbot
- Set the chatbot Status to Active, then message your WhatsApp number from a personal phone.
- Check the Conversations log to see which nodes fired and what variables were set.
- Use a test tag to limit the chatbot to specific contacts while testing: add a Condition node at the start that checks if contact_name equals your name.
- Disable the chatbot while editing to prevent partial flows from reaching real users.
- Check Session Variables in the contact's chatbot state to debug what values were captured.
Tip
Build your flow top-down: Start node → welcome message → first question → condition → branch A / branch B. Add the End Conversation node to every branch so sessions close cleanly.