how to do nested "with items" in orquesta? #5718
-
Hi all, During execution of a workflow, I want to find out if another workflow is already running (avoid duplicates). Basically, I need to process the result from st2.executions.list action=my.workflow status=running In python, I would do something like:
How can I do such a nested for loop in orquesta using "with items"? Would it be more effective and less complex to create a custom action and deal with this in python code? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
To control workflow concurrency use Policies https://docs.stackstorm.com/reference/policies.html, since attempting to perform concurrency management from an action that checks St2 execution state will more than likely encounter unresolvable race conditions. The is no concept of nesting If the StackStorm concurrency model doesn't fit your needs, you may have to look at an external distributed locking system, be it your own or a third parties. |
Beta Was this translation helpful? Give feedback.
To control workflow concurrency use Policies https://docs.stackstorm.com/reference/policies.html, since attempting to perform concurrency management from an action that checks St2 execution state will more than likely encounter unresolvable race conditions.
The is no concept of nesting
with-items
as per https://docs.stackstorm.com/orquesta/languages/orquesta.html#with-items-model, it's important to understand that results are not available per item iteration, but at the end of thewith-item
action in the form of a result list. Sowith-items
behaves nothing like a python loop.If the StackStorm concurrency model doesn't fit your needs, you may have to look at an external distributed lockin…