Do I need to store output workflow variables via E...
# 🤝help
p
Hi! I'm trying to follow the documentation here: https://botpress.com/docs/cloud/studio/variables/#input-and-output-workflow-variables My flows look something like this: Main -> BuyHome -> PrimaryLeadCapture -> back to BuyHome -> back to Main I've set a variable (e.g. contactInfo) in my PrimaryLeadCapture workflow that I'd like to use in the BuyHome workflow and later in my Main flow. I've tried using the code snippet in the documentation above like so (in my BuyHome workflow):
Copy code
workflow.contactInfo = {{workflow.variable_values.PrimaryLeadCapture.contactInfo}}
It's incorrect because contactInfo is a string and I can't store an object in there, obviously. But hopefully, you understand my intent; I'm confused about how to use the code snippet in the documentation to reference my nested workflow variable in the parent workflows. Also, not sure how to handle the error in the screenshot provided. Thanks for coming to my Ted Talk 🙂

https://cdn.discordapp.com/attachments/1135518766831239269/1135518766969655377/Screenshot_2023-07-31_at_6.20.47_AM.png

a
Hey @polite-truck-19716, have you seen Robert's video about passing variable values between workflows?

https://www.youtube.com/watch?v=2THIkCcehHM&t=1s

It goes over this exact use case
p
Hey @acceptable-kangaroo-64719 , I have watched that video. IIRC it covers passing the variable into the next workflow, but not as an output (i.e. Exit node) variable. Am I misunderstanding?
a
Yes, you can do it in the other direction, too. Just click on the exit node and then toggle the variables you want to pass out, just like you can toggle them as inputs on the entry node.

https://cdn.discordapp.com/attachments/1135518766831239269/1135545501312356462/image.png

p
right! I've done that as well, and you're going to think I'm slow, but I don't know how to access that exit node variable in the calling(?) workflow. Here's some screenshots to explain. @contactInfo appears to be empty after setting it in the previous workflow

https://cdn.discordapp.com/attachments/1135518766831239269/1135548096751865907/Screenshot_2023-07-31_at_8.17.03_AM.png

https://cdn.discordapp.com/attachments/1135518766831239269/1135548097062248488/Screenshot_2023-07-31_at_8.20.47_AM.png

https://cdn.discordapp.com/attachments/1135518766831239269/1135548097364234320/Screenshot_2023-07-31_at_8.21.20_AM.png

https://cdn.discordapp.com/attachments/1135518766831239269/1135548097838194740/Screenshot_2023-07-31_at_8.21.59_AM.png

pictured: my exit node on PrimaryLeadCapture (named GetContactInfo1 in the logs), the empty chat result, the node connection, the object containing the captured contactInfo
a
Hey @polite-truck-19716 I made this bot for you, I think it shows how you can complete your use case

https://cdn.discordapp.com/attachments/1135518766831239269/1135552035958300792/image.png

https://cdn.discordapp.com/attachments/1135518766831239269/1135552036277059594/outstanding-panther_-_2023_Jul_31_1.bpz
p
@acceptable-kangaroo-64719 , you're a rockstar. I had something very similar; I'm still not sure where I went wrong, but knowing that the workflows can be accessed by name as an array index is going to be very useful to me. Thank you so much!
10 Views