https://discord.gg/botpress logo
Workflow Variable Persistence?
# 🤝help
g
Hi! Are workflow variables not stored when testing a trigger within the studio? I'm setting event payload values to workflow variables through the code_execution card. And the text cards are picking up on them all the way through the node flow, but in the variable tab to the bottom left of the studio, they're all listed as Empty The code_execution card is linked by the custom trigger that feeds the payload to the card node ({{event.payload}}) , is as follows:
Copy code
js
const {dVer, dMod} = event.payload.payload // references the event payload values just fine verified through console log

workflow.dVer = dVer
workflow.dMod = dMod
I've tried to also set them to conversation-wide scope as well, and still to the same effect: the text cards immediately chained to the execute_code card picks up on the variables stored in conversation or workflow, but is not reflected in the studio UI in the variable tab. On a side note, when the bot loops back to a node that attempts to access
workflow.dVer
or
workflow.dMod
, the same text card that was able to read the values with no issue now present blank spaces where the passed in values would be. Thanks again in advance!
b
Hey bro, how does your workflow look like? prob you have to make 2 variables 1 for the capture card and the 2nd inside your execute code. Like: const dVer = captureCardVariable (im guiding from my personal experience)
g
Hi! Sorry this was a bit late, I’m not capturing from a capture card variable, the information is being carried in an event payload triggered from the published website on launch that is kept in {{event.payload}} in a custom trigger, which is then sent to the connected node to that which contains the execute code card that I try to use to store the variable value into workflow It’s strange because if I attach a text card in the same execute code node or in one that connects to it, it accesses {{workflow.varName}} just fine, but does not store in workplace variables afterwards
b
prob a Botpress error. It seems like the conversation variables for example are not stored in the "variables" tab (but somewhere inside the code)
have you tried visualizing the variable through console.log?
g
Yeah, I got in touch with someone at Botpress and he expressed that it is something being worked on, but also showed me that it did in fact update after walking me through an edge case that popped it up in the variables tab!
b
Cool!
4 Views