astonishing-waitress-91471
03/01/2026, 6:05 PMwindow.addEventListener('load', () => {
if (window.botpress) {
window.botpress.sendEvent({
type: 'trigger',
payload: { action: 'listings_page' }
});
}
});
Then trying to catch it in a condition node with event.payload.action === "listings_page". However I could not confirm whether this is the correct path to access the payload in a workflow condition.
Approach 2 — sendMessage Sending a silent trigger message based on the current page path:
window.addEventListener('load', () => {
if (window.botpress) {
const path = window.location.pathname;
if (path === '/faq') window.botpress.sendMessage('faq_page');
else if (path === '/contact') window.botpress.sendMessage('contact_page');
else if (path === '/listings') window.botpress.sendMessage('listings_page');
}
});
Then routing it in the Router workflow using event.payload.text === "faq_page". Not yet fully tested and unsure if this is best practice or if the trigger message is visible to the user.
Context
Using Botpress Webchat
Do you have any advice/right approach on this problem? Feel free to answer.
Thanks in advance!loud-crowd-60573
03/02/2026, 7:21 PMloud-crowd-60573
03/02/2026, 7:21 PM