I really believe that Cyclic workflows in vRO definitely have some use-case.
I created this workflow that can loop back to the same workflow item and moves forward based on defined conditions. I find it really useful with switch-case but you can virtually do this with any workflow item type. Let’s see it by an example. In this below mentioned workflow, the input is a string which takes part of the day viz. morning, afternoon, evening, night. And on the basis of it, it follows a cycle.
Let’s say, You want to find out what to do if its morning time. Pass it as input and…
it will print the tasks to do by the end of the day.
2021-11-29 03:50:32.610 -05:00INFOwhat part of the day: morning 2021-11-29 03:50:32.629 -05:00INFODo Morning Chores: 2021-11-29 03:50:32.630 -05:00INFO Take Bath Make Breakfast 2021-11-29 03:50:32.656 -05:00INFODo Afternoon Chores: Clean House Make Lunch 2021-11-29 03:50:32.676 -05:00INFODo Evening Chores: Go for Walk Sip a tea 2021-11-29 03:50:32.690 -05:00INFODo Night Chores: Make Dinner Read Book and sleep
Interesting Part is the workflow is going cyclic. Coming back to a central entity to check and proceed based on conditions.
The big question is why you want to do it this way, Mayank? Let’s answer that question. Suppose I have a workflow where I have to provision an entity let’s say vCloud:Organization for two type of customers (Managed Private Cloud and Virtual Private Cloud) which means that have different set of inputs and parameter values. Now, repeat these steps for 2 sites. Ideally, we can use Foreach Workflow element, Nested Workflow or Asynchronous Workflows and that’s totally OK. And I use them a lot. But this time, I thought why not keep everything in single workflow and see the whole execution flow getting completed.
That’s what I did. I created a cyclic workflow where on basis of whether the tenant id MPC or VPC, a switch-case checks the type as well as the site and then, it first provision vCloud:Organization in local site and come back to switch-case and then executes it again in remote site with slight difference in execution pattern. So I can execute these 4 scenarios in different order and different combinations without leaving my main workflow. Lovely.
Believe me, It’s a very nice feeling when some bi workflow executes with the execution jumping from one item to next and everything finishes perfectly with full logs and all. Ahh!
If you like this idea or if you already using it in your environment, feel free to share with me. I would love to hear your feedback. See you on next post.
I found a workflow Start workflows in a series in /Library/Orchestrator/Workflows folder which is cyclic in nature. It uses a decision activity as a center point.
Leave a Reply