cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow cannot be used as a child workflow because child workflows only support embedded connections

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-flo...). 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.

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

Add actionAdd 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: '.

2020-04-17_11-04-33.jpg

 

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:

2020-04-17_11-43-17.jpg

 

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):

2020-04-17_11-45-00.jpg

 

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 🙂

Meet Our Blog Authors
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Cambridge UK Power Platform User Group Leader, Technical evangelist and speaker. Always says yes to coffee! #LetsGetCoffee
  • Passionate #Programmer #SharePoint #SPFx #Office365 #MSFlow | C-sharpCorner MVP | SharePoint StackOverflow, Github, PnP contributor
  • I am building business processes and applications that are easy for users' to stick to, so they can follow and understand them. In overall I transform processes to be more reliable and effortless. I am a proud co-organizer of SharePoint Saturday Warsaw and active community member, blogger and international speaker.