Every time I deploy a solution containing a canvas app with a flow attached to it, to a managed environment, the flow errors out for a user the app is shared with (in the managed environment).
Example:
The workaround, which I was shown by an ISV consultant a few years back is:
In the managed environment:
1. Go to Default solution.
2. Edit the app.
3. Remove the flow from the app.
4. Immediately add it back in.
5. Save and publish the app.
Now the solution has an unmanaged layer in a managed environment.
If I try to update the solution, it works ok and no blockers are generated due to the unmanaged layer but I have to repeat the process of adding in an unmanaged layer to the app. I am using pipelines but the same thing happens if I use package export and import.
Can someone point out if I am missing an important step? I would prefer not to have to introduce unmanaged layers in a managed environment and for the app deployment to work first time without manual editing in the prod environment.
Appreciate any help on this.