Bring Variable data from one workflow to another
# 🤝help
b
Hey guys, I am working a a big project and have a lot of cards in the main workflow. So I decided to split the main workflow up into more workflows. Now I run into the issue, that I collect data in the "Workflow B" but want to have them in the same variables in the Main Workflow. How I can achieve that at the end of "Workflow B" all collected data in the variables are forwarded to the main workflow variables? Found this in the docs but its not working well https://botpress.com/docs/cloud/studio/variables/#to-mark-an-output-variable Hope my issue is clear, otherwise always ask 😉 😅
w
Oh you got me stuck
The only thing I see for now is to create user variables and use it through different workflow
Or to use user variables and as soon as you exit workflow B, you assign the values of those variables to workflow variables
Maybe someone will have a better answer 😅
b
Okay but how I would assign the values to the other variables ? With an ai task ?
w
just with a bit of code
like workflow.varA = bot.varA workflow.varB = bot.varB
b
Okay can I also use code to copy values from one workflow variable to another workflow variable (different workflow)
w
I don't think so, because workflows are compartmentalized in terms of variables, which is why I suggested using user or bot variables.
b
Yeah I know would do so the same for new projects but got a lot of workflow variables running which I don’t want to copy because they will be forwarded to an backend. So user variables might crash it 😅
But I will try with the code snippets and try to mirror the values
Thanks for your help
w
Okay i see
honestly i don't see any other solution
b
lets see will try it today
Hey to keep you updated, it actually didnt worked but maybe i just entered the wrong code snippet.
w
can you share your code snippet, and the place you are executing it in the workflow, and any relevant information that could help ? will try 😅
3 Views