How to store a python script output to a variable using publish in workflow scripts

Hi All,

Please help on how to store a python script output to a variable using publish in workflow scripts

Thanks,

Very simple:
for action-chain:
https://docs.stackstorm.com/actionchain.html#variables
for orquesta:
Publish your vars in Task Transition section
https://docs.stackstorm.com/orquesta/languages/orquesta.html#task-transition-model

When you use Python script as action, you must implement run() method from BaseAction class. This method’s return value can be assigned to the variable in the workflow.

https://docs.stackstorm.com/actions.html#writing-custom-python-actions
In the above example, message variable value returned from the run method will be published to a workflow variable of the same type. The syntax is like below:

publish: 
        - msg: <% result().result %>

where msg being a variable declared in the orchesta workflow.

Thank you @bryan and @arms11 .