Top

Quick tip: flow cannot be used as a child flow


Have you seen that huge warning, when trying to add a newly created Power Automate flow as a child flow, saying: “The workflow with id '<ID>', name <NAME> cannot be used as a child workflow because child workflows only support embedded connections.“? Looks scary! What does it mean? How to fix it? Let me show you!

Child flows

Child flows were introduced to Power Automate by the end of October 2019 (https://docs.microsoft.com/en-us/power-platform-release-plan/2019wave2/power-automate/call-child-flows). They gained quickly positive feedback, as they let you to easily create multiple patterns in Power Automate such as state machine or long running approvals.

The other highly desired scenario that is possible to be created with Child Flows is elevation of permissions, as I described it here: https://poszytek.eu/en/microsoft-en/office-365-en/powerautomate-en/elevated-permissions-in-microsoft-flow/.

To create one, simply build a flow that is triggered by manual action and then finish with “Response to PowerApps or Flow” action:

Important! To be able to call flow as a Child Flow, both the Parent and the Child Flow must be in a Solution.

The error

When you create a flow, that you want to use as a child flow, and you use in it actions that uses connections (eg. to SharePoint or Outlook), then when trying to add that flow you will see the following, long and very scary error:

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"ChildFlowUnsupportedForInvokerConnections","message":"The workflow with id '<ID>', name <FLOW NAME> cannot be used as a child workflow because child workflows only support embedded connections."}}". Code: 0x80060467 InnerError: Type: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"ChildFlowUnsupportedForInvokerConnections","message":"The workflow with id '<ID>', name <FLOW NAME> cannot be used as a child workflow because child workflows only support embedded connections."}}". StackTrace: at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Update(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Boolean checkForOptimisticConcurrency, Dictionary`2 optionalParameters) at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Update(Entity entity, UpdateOption updateOption) at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject) at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta) at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() InternalException: '.

The reason? Simply – the connections you use and are defined inside the child flow are embedded. What it means? This means, that when calling that flow it would still try to get user context to execute the connections, not use the ones defined by the flow’s author. So in the end – the flow cannot be added as child flow because in such scenario user context is lost and the flow is expecting it to have. And embedded connections, by default, can only be executed by the flow owners. So you need to define, who can use them.

The solution

Go to your flow that you want to add as a child flow. Open its details page. Then hit “Edit” in the “Run only users” box:

Each connection you have defined in your flow is by default set to be run by the current user (1). To fix the issue, change it to use one of the defined connections, so that it won’t need the user’s context (2):

Once that done, go back to your parent flow and try to save it again. Issue is resolved!

I hope this short post will help you. In case you have any questions, simply leave a comment or contact me using the form.


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.

13 Comments
  • Necdet Saritas

    How can I follow your page?

    May 16, 2020 at 3:54 pm Reply
  • Sarvesh Shinde

    Hi Tomasz,

    Thanks for this and other blog about how to run child flow as part of one solution. I am getting below error though, could you please let me know whats wrong here.
    {“code”:”ChildFlowsUnsupportedForNonOpenApiConnections”,”message”:”The workflow with id ’86bd8f60-90c6-ea11-a812-000d3a59ff91′, name ChildFLOW1 cannot be used as a child workflow because it is on an old version of Flow. Please re-create it inside a solution.”}}

    I have done above configuration, both the flows are part of same solution. Appreciate your response.

    Thanks
    Sarvesh

    July 15, 2020 at 1:43 pm Reply
    • Tomasz Poszytek

      Hi, I remember you wrote to me via other channel you got it working. Could you possibly write here what you’ve done?

      July 28, 2020 at 7:48 am Reply
  • S de Bie

    I still get the error after changing Manage run-only permissions > Common Data Service > Use this connection. The one of my own instead of run-only user.

    Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”ChildFlowsUnsupportedForNonOpenApiConnections”,”message”:”The workflow with id ‘dcc005b9-98cd-ea11-a812-000d3a249d47’, name Automated SoW Create csv out of GA data on manual trigger cannot be used as a child workflow because it is on an old version of Flow. Please re-create it inside a solution.”}}”. […]

    July 26, 2020 at 7:15 am Reply
    • Tomasz Poszytek

      I think it clearly says, that you should re-create your workflow inside a solution. So I’d suggest you create it from a scratch inside a solution, on that environment where your parent flow is located.

      July 30, 2020 at 8:24 pm Reply
  • YKSiddal

    Hi ,
    currently we have M365 license , To create solutions in power automate , do we need to have per flow or per user license ? when i click on solution on power automate left nav , it says create environment first .

    August 9, 2020 at 8:54 pm Reply
    • Tomasz Poszytek

      Hi! I faced the same issue recently and asked fellow MVPs for help. The one and only Rob Windsor replied, that you can do this using the Power Platform admin center or by just creating a flow that uses the Approvals connector. Since the Approvals connector stores data in CDS, it will โ€œmagicallyโ€ create a database in appropriate environment if one does not already exist. It worked for me, let me know if it worked for you too.

      August 10, 2020 at 10:46 pm Reply
  • Ingeborg Hawighorst

    I created the child flow in the solution. I created the master flow in the solution. I still get the error that the child flow has been created in an old version of Flow. All connectors are set how you describe. What is wrong?

    August 19, 2020 at 2:38 am Reply
    • Tomasz Poszytek

      What connectors are you using? Is CDS one of them? If so, does it have the “current environment” setting? I’d say, that it may be causing the issue and in that case I’d recommend to re-create the CDS actions. If that won’t help – build the flow from scratch.

      August 19, 2020 at 11:57 pm Reply
  • Laura Rogers

    Hi Tomasz,
    This must be new. My parent flow is now telling me “Update the child flow to end with a response action.” The only response actions I see, are all premium. Any workaround?

    September 17, 2020 at 4:36 pm Reply
  • Laura rogers

    Ohhh I found it, it has the PowerApps logo, and is called “respond to a PowerApp or flow”.

    September 17, 2020 at 4:38 pm Reply
    • Tomasz Poszytek

      Yes, exactly ๐Ÿ™‚ And this is not really new. It is with us for some time already. I am really glad that one – you wrote to me and two – you found answer by yourself ๐Ÿ™‚

      September 23, 2020 at 2:30 pm Reply

Post a Comment

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