New day, new scheduling problems!
We had some difficulties with scheduling in Viya before. The first (Jobs and Flows - How do I schedule a flow?) turned out to be a bug, the other (How do I make my scheduled flow to actually run?) a user mistake.
Let´s what´s the problem this time. 😊
The task
We have three different flows “Personal-data”, “Senioralert 1-8” and “Swedeheart 1-8”. Each of the flows contains a number of SAS Studio flows who are to be run in a certain order.
“Senioralert 1-8” and “Swedeheart 1-8” can run in parallel, but “Personal-data” must run befor them both.
We created the flow “Nattbatchen” ( “The night batch” in swedish 😊) that contains “Personal-data”, “Senioralert 1-8” and “Swedeheart 1-8”.
💡 The flows in the pictures below are built in Environment Manager --> "Jobs and Flows". Not to be confused with the kind of flows that are built in SAS studio.
Here are pictures of all four flows:
![FredrikHansson_0-1674211362721.png FredrikHansson_0-1674211362721.png](https://communities.sas.com/t5/image/serverpage/image-id/79550i4E310CAF8E79F638/image-size/medium?v=v2&px=400)
![FredrikHansson_1-1674211362745.png FredrikHansson_1-1674211362745.png](https://communities.sas.com/t5/image/serverpage/image-id/79551iEBC036AECC7DB150/image-size/medium?v=v2&px=400)
![FredrikHansson_2-1674211362772.png FredrikHansson_2-1674211362772.png](https://communities.sas.com/t5/image/serverpage/image-id/79552iBECD967DA82D15CC/image-size/medium?v=v2&px=400)
![FredrikHansson_3-1674211362784.png FredrikHansson_3-1674211362784.png](https://communities.sas.com/t5/image/serverpage/image-id/79553i447E9B4B6B2B7693/image-size/medium?v=v2&px=400)
(as you can see there is more happening in “Nattbatchen”, but it shouldn’t be relevant to my issue)
My problem
When I trigger the main flow “Nattbatchen” manually (by right-clicking and selecting “Execute” everything executes in the order I expect it to.
But when I schedule “Nattbatchen” the order in the subflows ar not respected. All SAS Studio Flows in the “Personal-data”-flow are triggered at the same time.
I hope these pictures will describe the problem better:
Expected behavior (happens when running “Nattbatchen” manually)
![FredrikHansson_4-1674211362819.png FredrikHansson_4-1674211362819.png](https://communities.sas.com/t5/image/serverpage/image-id/79554iFA9DA226C1F95B60/image-size/medium?v=v2&px=400)
As you can see the pdbatch*-flows run one at a time. Sa2batch*-flows run one at a time, shtbatch*-flows run one at a time (in parallel with sa2batch* which is what I want)
Unexpected behavior (happens when “Nattbatchen” is scheduled to run at a specific time)
![FredrikHansson_5-1674211362853.png FredrikHansson_5-1674211362853.png](https://communities.sas.com/t5/image/serverpage/image-id/79555i2027B9D7DE9FA53D/image-size/medium?v=v2&px=400)
All pdbatch-flows are started at the same time. Shtbatch* and sa2batch* waits for pdbatch, but are then started all at the same time.
We are using Viya 2022.09. Is there someone experiencing the same problems?