Debugging Bot Behavior in Production
There are a few different ways to debug your bot's behavior in production:
The Conversations tab allows you to view the conversation history of your bot which is great for identifying problems. Check out this page to learn more.
If your bot is live and already has users it's recommended to duplicate the bot to debug its behavior. This will allow you to safely test and debug without affecting your live bot. To do this:
- Export your bot by clicking the Botpress icon.
- Select "Export" and save the exported file.
- Go to app.botpress.cloud (opens in a new tab) and log in or create an account.
- Create a new bot within the platform.
- Click the Botpress icon and select "Import from file".
- Select the exported file and wait for the import.
You can add Text Cards at different stages of the conversation to isolate problems:
- Insert Text Cards in various parts of the conversation.
- Deploy the bot to production and engage with it.
- Observe where the conversation deviates from the expected behavior using the text cards as indicators.
For more detailed debugging, utilize
console.log statements in the logs:
- Add Execute Code cards containing
'message'with relevant information or variables like
- Deploy the bot to production and trigger conversations.
- Check the Logs tab to analyze the flow of the conversation and gather more information about the bot's behavior.