Table of contents:

Have you faced this issue when trying to turn on a child flow, that you deployed to another environment? I think I found a solution!

One day I deployed a solution (using Power Platform Pipelines) to a prod environment, that contained several child flows. The child flows were off after the deployment, so I tried to turn them on. When I did, I saw this red error reading:

Turn on failed. Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”ChildFlowNeverPublished”,”message”:”The workflow with id ‘{some-guid}’ cannot be used as a child workflow because it has never been published. Child workflows need to be published at least once before they can be included in a published parent workflow.”}}”.

I tried then to import the solution manually, but in that case the error occurred immediately, after the import.

More investigation

I started looking into what could that error mean, however there were really no information on the internet. My first idea was it might be related to the newly released functionality allowing versioning, saving draft and publishing major versions of cloud flows:

What I did was to hit “Publish” again on all the processes involved in my automation. Then deployed the solution again just to realize, it faces the same error.

Then I thought about the “Publish all customizations” functionality on a solution level (even though this feature is not meant for cloud flows – source). No progress.

The solution

What made me curious as well and led to think this is not related to the versioning feature, was the fact that the issues for the mentioned error code were first reported around 2021. Anyways, I tired as well to deploy it as unmanaged – same issue. Other account – the same. What put some light was when I was trying to delete solution components from the environment after I deployed it as unmanaged. This is when I realized, that I had there a circular reference, disallowing me actually to remove the components:

I was not able to delete “Stage” child flows, because they were referenced by a state machine child flow, and vice-versa. I have then implemented a small change:

After I have implemented the above change and deployed the solution again, I was finally able to successfully turn on all the cloud flows.

I don’t have any official statement from Microsoft on this error, whether this is by design or if this is some kind of an issue in solutions. If I learn anything, I promise to update this post 🙂 Anyways – I hope this solution will help you too.

Tomasz Poszytek

Hi, I am Tomasz. I am expert in the field of process automation and business solutions' building using Power Platform. I am Microsoft MVP and Nintex vTE.

  • Piotr Albertin

    Thanks for sharing Tomek.
    Several weeks ago, I faced a very similar issue. After investigating, it turned out that one of the flows had been included in multiple solutions, and someone had temporarily disabled one of the child flows. If only we had paid more attention to those two lines during PR 🤦‍♂️
    1 2

    May 27, 2024 at 5:09 pm Reply
    • Tomasz Poszytek

      Hey, thanks for sharing ☺️
      I think a similar situation can be avoided when using Power Platform Pipelines as it checks the dependencies when preparing a deploy ☺️

      May 29, 2024 at 8:40 am Reply

Post a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.