Hi,
I'm wondering if I'm correctly importing (child) flows between solutions and environments. Not sure if my process is correct or if I'm following the best practices.
For example, if I want to create and use some utility/helper flows related to Excel, in dev I first create a solution called "Utilities-Excel" and in there I create some utility flows.
1. My first doubt is whether at this point I should be creating this Utilities-Excel solution or if I should just create the utility flows directly inside the Default Solution (?). For organization, I thought creating this separate Utilities-Excel solution was a good idea but now I'm not sure.
Then I create another solution ("main solution"), which will host the actual bot, and I create some flows there. In those flows I need to 'Run child' some of the Utilities-Excel flows. This has always worked fine in dev.
However, I'm not sure if this is causing me problems with my "devops". When I manually export the managed solution from dev and import it into prod, I oftentimes run into issues. Sometimes I can simply import with an upgrade (if I don't get any missing dependencies errors or similar), sometimes I resort to an update (which is terrible because it just brings in new flows into the solution but leaves old ones there as well), so other times I go with the nuclear option: I delete the prod solution and import the dev solution as if it were new (which erases environment variables and causes me headaches). I think these issues are due to my incorrect creation/use/importing of child flows? One or both of these cases may lead to issues.
Case A: In some of my initial projects I was not aware of the +Add required components functionality, so in dev I would have a solution without any utility flows and the separate Utilities-Excel solution. I would import these 2 solutions separately into prod, sometimes struggling as described above, but the prod flows would ultimately work.
Case B: In more recent projects in dev I click on +Add required components for every flow inside the bot's solution (tedious but w/e). This pulls in the utility flows into this main solution. I then send this solution to prod. I'm not sure if this produces all of the same issues described above, but
2. I suspect that using the +Add required components helps avoid at least some of them and is the way to go (?)
In any case, I have learned the hard way that it's also a good idea to delete unmanaged layers in the prod solution (allows most updated version of flow to appear in prod). I've also learned to re-save the newly imported prod flows (allows them to start using any modified environment variables). These two steps are perhaps not related to how I use child flows, but they might be worth mentioning.
Finally, in my prod solution, when inspecting the utility flows, I notice a first layer associated with the Utilities-Excel solution as well as a higher layer associated with the main solution.
3. Should I be seeing this sort of layering?
What's more, often there are other higher layers from other solutions that also make use of the same utility flow. I'm pretty sure this shouldn't be happening and in fact I've read somewhere to avoid cross-solution dependencies.
I wonder where I'm going wrong. In summary, I'm guessing the proper way would be create utility flow in default solution > add utility flow to main solution with +Add required components > export it to prod. In other words, I believe prod should never have a Utilities-Excel solution as such, but I was hoping to confirm.
Thanks!
PS. I'm looking into the Power Platform Build Tools, which I hear might help avoid some of these devops issues, but for now I'd like to understand if I'm doing anything wrong with my manual method.