Typebot Integration
Typebot is a powerful open-source chatbot builder that lets you create advanced conversational flows with a visual interface. You can integrate Typebot with Evolution API to deliver these flows through WhatsApp.What is Typebot?
Typebot allows you to build chatbots with a drag-and-drop interface, supporting:- Interactive conversation flows
- Form collection and validation
- Conditional logic and branching
- Webhook integrations
- Variable management
- Multi-language support
Enable Typebot Integration
Add these environment variables to your.env file:
The
TYPEBOT_API_VERSION determines which Typebot API endpoint format is used. Use “latest” for newer Typebot versions (v2.0+).Configuration Settings
Create Default Settings
Before creating Typebot bots, configure default behavior settings for your instance.Settings Parameters
Session expiration time in seconds. Default: 300 (5 minutes)
Keyword to terminate the bot session. Example: “#EXIT”, “bye”
Delay in milliseconds between messages. Default: 1000
Message sent when bot doesn’t understand user input
Whether bot responds to messages sent by the instance owner
Whether instance owner can stop the bot session
Keep session open after completion. Default: false
Seconds to wait before processing rapid messages. Default: 10
List of JIDs (phone numbers) to ignore
Fallback Typebot ID to use when primary bot fails
Create a Typebot Bot
Configure your Typebot
Create and configure your bot flow in your Typebot instance. Note the Typebot URL and bot ID.
Request Parameters
Enable or disable this bot
Description of the bot purpose
Your Typebot instance URL (e.g., “https://typebot.yourdomain.com”)
Your Typebot flow ID from the Typebot dashboard
Trigger type: “all”, “keyword”, or “advanced”
For keyword triggers: “equals”, “contains”, “startsWith”, “endsWith”, “regex”
The keyword or regex pattern to trigger this bot
Trigger Types
All Messages
Respond to every message (only one “all” trigger allowed per instance):Keyword Trigger
Trigger based on specific keywords:equals- Exact matchcontains- Contains the keywordstartsWith- Message starts with keywordendsWith- Message ends with keywordregex- Regular expression match
Advanced Trigger
Use regex for complex pattern matching:Start Typebot from API
You can programmatically start a Typebot session for a specific contact:WhatsApp JID of the recipient (format: [email protected])
Set to true to start a new session
Prefilled variables to pass to Typebot flow
Update Typebot Bot
Modify an existing Typebot configuration:Delete Typebot Bot
Remove a Typebot bot from your instance:Fetch Typebot Bots
Retrieve all Typebot bots configured for your instance:Session Management
Change Session Status
Update the status of an active Typebot session:Fetch Sessions
Get all active Typebot sessions:Webhooks
Evolution API emits Typebot-specific webhook events:TYPEBOT_START
Triggered when a Typebot session begins:TYPEBOT_CHANGE_STATUS
Triggered when session status changes:.env:
Use Cases
Customer Support Automation
Customer Support Automation
Create interactive support flows that:
- Collect customer information
- Categorize support requests
- Route to appropriate departments
- Provide automated responses to common questions
Lead Qualification
Lead Qualification
Build conversational flows to:
- Qualify potential leads
- Collect contact information
- Schedule appointments
- Send information to your CRM
Survey and Feedback Collection
Survey and Feedback Collection
Design surveys that:
- Collect user feedback
- Measure customer satisfaction
- Gather product insights
- Export data for analysis
Order Processing
Order Processing
Implement order flows that:
- Display product catalogs
- Process orders and payments
- Confirm delivery details
- Send order confirmations
Best Practices
Use the
debounceTime setting to handle users who send multiple rapid messages, preventing duplicate processing.- Design clear exit points: Always provide users with a clear way to exit the bot (keyword finish)
- Test your flows: Thoroughly test Typebot flows before deploying to production
- Use variables: Leverage prefilled variables to personalize conversations
- Monitor sessions: Regularly check active sessions and clean up stale ones
- Handle errors gracefully: Configure meaningful unknown messages for better user experience
Troubleshooting
Bot not responding to messages
Bot not responding to messages
- Verify
TYPEBOT_ENABLED=truein your environment - Check that the bot is enabled (
enabled: true) - Ensure trigger conditions match the incoming message
- Verify Typebot URL is accessible from Evolution API server
- Check that only one “all” trigger exists if using that type
Session expires too quickly
Session expires too quickly
- Increase the
expirevalue in settings (in seconds) - Set
keepOpen: trueif you want sessions to persist - Check that users aren’t triggering the keyword finish accidentally
Duplicate messages being sent
Duplicate messages being sent
- Increase
debounceTimeto wait longer before processing messages - Check that you don’t have multiple bots with overlapping triggers
- Verify
listeningFromMeis set correctly based on your needs