Hi everyone,
I have a workflow will be run in server after ALL others workflows finish.
-----workflow_1-----
-----workflow_2-----
-----workflow_3-----
--------------------workflow_4------->
for example, workflow 4 will run after all 1,2,3 finish. And workflow_1,2,3 can be run in parallel in server to optimize time. I have searched to find solution but there is only run sequel wf_1 --> wf_2 --> wf_3 --> wf_4 by using CReW.
Do you have advice for me. Thanks
Hello @huynv96,
The only solution I can think of is to run your workflows as chained apps.
In my example, you could create a file that is generated after each workflow runs. For example:
W1 -> W1_Finished.txt
The second app would then be then always the W4. This would first check if all the files are created. Since all the files would only be available once the three other worklflows have finished, W4 would only run once.
After running W4 you could delete the files "W1_Finished.txt" to be ready for the next run.
It's a little bit unorthodox but it's the only solution I could think of.
Regards
Thanks your response @afv2688 . Can you explain more and give me an example about chained app?
Hello @huynv96,
to create chained app you need to transform your workflows into applications. Once you have them as apps you can open the interface designer (cntrl + alt + d) and select the option to 'on success run another app' and select the application you would want to run, which in this case would be W4:
The way they work is that once the first app is finished, the second app will inmediately pop up without the need to do anything.
If you need any further explanation or help don't hesitate contacting me
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Regards
If you have scheduling software like Control-M available, you can use it to run workflows from command line and a bat file.
A different hack option would use a messaging table and a controller workflow.
Using your example, let's call the controller workflow C
Start workflows 1,2,3, and C
Workflows 1,2,3 will post to a messaging table as last step.
Workflow C will read the table and have a detour
If 1,2,3 have all posted, start 4 and empty message table
Else wait some time and re-run itself using a run command tool and bat file
Good option @afv2688 , But how if i need to optimize time by using optimize server resource to run 1,2,3 in parallel,your solution seems the workflow will run 1 --> 2 --> 3 --> 4.
Thanks. @hroderick-thr For your solution. How do we know which exactly time we check file and run workflow 4. A loop check in period time?
Hello @huynv96,
My idea was to concatenate each worfklow with W4. After each one is finished the first thing they would do is create a text file
W1 -> create W1finish text file -> [[Condition: Are there W1finish text file, W2finish text file and W3finish text file]]?? -> Run W4 -> delete finish text files
W2 -> create W2finish text file -> [[Condition: Are there W1finish text file, W2finish text file and W3finish text file]]?? -> Run W4 -> delete finish text files
W3 -> create W3finish text file -> [[Condition: Are there W1finish text file, W2finish text file and W3finish text file]]?? -> Run W4 -> delete finish text files
The idea is, that W4 would only run once, since the three files would only be present once all workflows have ended. For the other two, since the other files would still not be generated then W4 would not run
Regards
The only loop would be C rerunning itself
When C finds 1, 2, and 3 had not finished, it would run C
When C finds 1, 2, and 3 had finished, it would run 4
There is no time check.
You could delay C running C a minute or more
You could start the scheduled run of C a little later than 1, 2, 3 to give them time to finish before it begins checking
Thank you so much @afv2688 @hroderick-thr , I will try