https://discord.gg/botpress logo
Webhook Trigger: Payload received, but conversatio...
# 🤝help
m
Hey everyone, I’m using a Webhook Custom Trigger in Botpress to receive a JSON payload from an external system called Postman. The trigger fires correctly, the flow starts, and I get the initial greeting message from the bot. Right after the trigger, I use an Execute Code card to extract the payload and store values like invoiceNumber, rejectionReason, invoiceDate, etc. in conversation. or session. variables. I also manually assign event.userId and event.conversationId from the payload. The problem: As soon as the user sends a message (e.g. "Why was my invoice rejected?"), Botpress logs Conversation started and jumps back to main.flow.json. At that point, all variables stored in conversation. or workflow. are lost. What I’ve already tried: -Setting event.userId and event.conversationId immediately after the webhook -Confirmed that the payload is received and values are correctly stored before the jump -Tried storing in both conversation. and workflow. scopes Goal: I want to store contextual data from the webhook and keep it accessible across flows, even if the conversation transitions. How can I ensure the data persists and the conversation doesn’t reset unexpectedly? The user who solves this problem gets 15€ on paypal, I'm that desperate 🥲 Thanks in advance 🙏
p
You can use conversation variables instead of workflow ones to store your data. Also, overwriting the automatically generated userid and conversationId will break your bot.
l
@melodic-electrician-28295 - Please pass the Euros to @prehistoric-airplane-85682 😀 You may also try by connecting the Webhook Trigger workflow back to your main workflow, so that it can resume from where it left off. This way, when the user writes back, it is back in the workflow and not resumes from the start
e
The same issue here 🙋‍♂️ But save data in the conversation variables didn't work too, because them are removed too when a client send the first message. No one of the scopes keeps the data
m
I really wish you were right but this didn't worked out for me sadly
this didn't worked out for me too 😦 at the moment i would even quadruple the reward for the solution, if there is a way to get around this problem with a more complicated solution I would also gladly take it
did you already find a solution for this problem? 🙂
l
Let's have a call to review the issue
p
Are you trying to use the webhook as a conversation starting trigger?
e
@melodic-electrician-28295 Hi I have an idea (diagram), but I haven’t had the time to test it. My concern is whether the data removal issue with the first user message has occurred. I am unsure if it only occurs on the studio emulator or if it could also happen in the published bot. Since this diagram only explains how to obtain the resulting conversationId, I am not sure how it works afterward. https://cdn.discordapp.com/attachments/1376621723415220254/1388107974886555738/image.png?ex=685fc7cb&is=685e764b&hm=b0aa566c2fe5e849f6867994376cb55d90c9776a116731dff1ab8764a6c4f810&
l
I was able to solve @melodic-electrician-28295 problem, we can @elegant-nail-86477 review this together
g
Hi there, @limited-pencil-78283 m @elegant-nail-86477 im having the same issue --- did you fix it?
14 Views