Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Best way to pass variables or parameters to a sub-workflow?

vitor_d
Level 2
Level 2

I am attempting to create shared (sub) workflows which other users could reuse them to do common tasks. What would be the best/proper way to pass variables that would work as parameters to these sub-workflows?

 

Atm I am using instance variables, but I have a major issues with it. The following workflow, for example:

 

nlclient_C0kTDNBQBT.png

Both sub-workflows use the instance.vars.parameter. Internally, on my sub-workflow, I would build a logic that halts the execution if the variable/parameter is not properly set. But, if the user forgets to set it on the second fork path, it will use the same instance.vars.parameter value of the first fork path.

 

Does anyone have any suggestions on how to approach it?

Question workflow
1 Accepted Solution
wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

AFAIK it's just instance.vars available to sub-workflow, though can also use xtk:option with get/setOption().

Set a diff parameter for each path?

 

Thanks,

-Jon

View solution in original post

1 Reply
wodnicki
Correct answer by
Community Advisor
Community Advisor

Hi,

 

AFAIK it's just instance.vars available to sub-workflow, though can also use xtk:option with get/setOption().

Set a diff parameter for each path?

 

Thanks,

-Jon

View solution in original post