https://discord.gg/botpress logo
Sub-workflow variable not persisting back to paren...
# 🤝help
m
I have a sub-workflow called Refresh_Dataset that contains an execute code card with this single line: workflow.current_dataset = workflow.place_category_1 The sub-workflow is called as a tool from an Autonomous Node in my Main workflow. Both current_dataset and place_category_1 are declared as workflow-scoped variables in the Main workflow with Allow Write Access enabled. I have also declared current_dataset as a variable inside the Refresh_Dataset workflow itself. I have toggled both the place_context and current_dataset variables in the Exit node. After the sub-workflow runs I can see in the logs that the execute code card executed successfully. However in the Main workflow variables panel current_dataset remains Empty after the sub-workflow exits. Question: How do I make a variable set inside a sub-workflow persist back to the parent workflow scope? Is workflow. inside a sub-workflow scoped to the sub-workflow only, and if so what is the correct way to pass a value back to the parent?
l
Hello @miniature-processor-86635 My suggestion would be to use a user-variable instead! Let me know how that works 😄
2 Views