I’d like to create a workflow that performs an atomic unit of work and share it between parent workflows. When calling an automation script from a workflow, I can pass variables to it. Is there any way I can do that with a subworkflow?
I see a scope option, but it’s documented as passing the scope of the subworkflow back up to the parent workflow, and not any scope from the parent workflow down to the subworkflow.
Are there any workarounds, or am I missing something?
Sorry, it’s not in the documentation, it’s in the workflow help tooltip.
It says
Execute a workflow and map variables from its scope to the current one
Is this description accurate?
I aslo see that you can map results. Is there a difference between the scope mapping and the results mapping? Am I using the results correctly in the image below?
For sending stuff in the WF: create a variable of type “Vars” and pass it in scope param.
For getting stuff out of the WF: add “result” for each variable in the subwf scope and “copy” it back to the current scope.
I have 2 workflow that you can import and play around with.
It plays the scenario of inputting vars into the sub-workflow and retrieving vars from the sub-workflow and printing it on the main wf.
I see what you mean. Altough the subworkflow you attached is not importable (the json content is not properly populated as you noted in your github issue ).