How Botpress send message to outer in web chat?

Currently, i wrapped botpress into my react app, but for some case, i want to send message to outer app in some flow or topic step, but i can’t find how to realize this? and in execute code action, i want to use window.postMessage it will say window is can’t find.

Hi @calum.chen ,

This is not possible currently, we are working on something to avail this. Is it possible to give me more context about what you are trying to achieve? maybe we can find a workaround together

yes, just i want botpress to be a tool for my app, maybe interact with customer, help custom to organize what they want. After they finished their flow in botpress, input what they want. And then, i want this message to be used in my system, or the event they finished the flow in botpress I want to know, because I need this time to do some(maybe alert something or others).

Why don’t you use API calls?

Step 1: Create a workflow variable (type: Object)

Step 2: Select Execute Code Card and use the below code to send an API Request.

try {
const response = await axios.get(‘’)
catch (error) { console.error(error) }

Step 3: Add a text card with workflow.variable.parameter after the sample API request card.

1 Like