Request to XRM API failed with error, the flow is missing a connection for api ‘< null >‘

Today when i tried to save my flow I got the following error message Request to XRM API failed with error. What to do when you get this error?

Request to XRM API failed with error

The full error message that I got looked like this:

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest"
Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest”

Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”FlowMissingConnection”,”message”:”The flow is missing a connection for api ‘<null>’. Reauthenticate the connection or remove from the flow and re-save.”}}”. Code: 0x80060467 InnerError: ‘.

Looking at my flow, nothing seem to be wrong. As I opened a new tab to open the solution containing my flow I could see that my flow hadn’t saved for 24 minutes.

Flow hadn't run for 24 minutes
Flow hadn’t run for 24 minutes

Now I could of course just reopen the flow that I saved 24 minutes ago but that is a bit of a pain. I hate doing the same thing twice!

So how to solve the problem?

This post is going to be a real SharePain as I will go through my attempts to resolve the issue. If you have come across the Request to XRM API failed with error message without the connector being mentioned then please let me know if you solved this in a better way. So far I’ve only found people reporting this problem related to specific connectors.

Attempt 1 – Failed

My flow from 24 minutes ago looks like this when I opened it in a new tab:

Recurrence flow with List Folders action
Recurrence flow with List Folders action

I don’t really want to redo my work as my flow with the updates, that haven’t been saved yet, looks like this:

Try catch added to my flows
Try catch added to my flows

The Try-Catch pattern could actually help me to fix my flow quickly as I can copy each scope box to my clipboard.

Copy the try box
Copy the try box

And then I can add the 3 scope boxes to my flow in my other tab of my browser. It’s quite useful that it is possible to use copy/paste of steps across multiple tabs.

Clip board actions available for Try, Catch and Finally
Clip board actions available for Try, Catch and Finally

All I now have to do is configure the runafter settings for the Catch and the Finally scope boxes and my flow can hopefully be saved again.

Run after settings for try catch steps
Run after settings for try catch steps

But no luck there! The problem was still there. Ok, this might be a failed attempt but it did make me understand that the problem is potentially related to copy/paste.

The Error message mentions XRM API so that means that the problem is something to do with solutions.

Attempt 3 – Getting closer!

So now we know that there is actually something wrong with the content of the flow after the copy pasting of actions.

The flow is still giving us the same error! It wasn’t until I looked at the solution that holds my flow that I found the issue.

My flow has an send an email action in it and the Connection status for the Outlook connector is set to Off.

Connection reference is off
Connection reference is off

I’m not that quickly beaten, so I looked for the option to enable the connection or to turn it on! But there doesn’t seem to be an option for that.

No option to turn on connection reference
No option to turn on connection reference

Then I looked at the flow itself using the New Connection reference.

Connection reference in the flow
Connection reference in the flow

But this resulted in a further mess within my flow.

Send an email action with broken connection
Send an email action with broken connection

We might need a different approach.

Attempt 3 – Success!

The final attempt now. I deleted the Send an email action and then re-added the send an email action and now it is possible to save my flow.

Re-added the send ana email action to my flow
Re-added the send ana email action to my flow

And once it the flow is saved, we will find an invalid connection for Office 365 Outlook. So we now know that there is a problem with the outlook connection!

And when we now select that invalid connection reference and save the flow all connections seem to be valid again.

Valid flow after the fixes applied
Valid flow after the fixes applied

You would now expect that the connection reference in the solution to be switched to on, but that is not the case. So it looks like the Status of a connection is just a red herring.

So what caused this problem? The Request to XRM API failed with error message is definitely annoying and even more annoying when the connector causing the problems isn’t mentioned in the error message.

The problem found!

So as a bumped into this problem a few more times, I wanted to know what caused this problem.

I created a totally new solution. Then I added a flow that looked like this.

A new solution created
A new solution created

I saved the flow and then added another flow to my solution. But this time I copied the Send an email action from my first flow ( yes I’m lazy and didn’t want to type the settings!)

Same error happened again
Same error happened again

The same error occurred again


Request to XRM API failed with error: ‘Message: Flow client error returned with status code “BadRequest” and details “{“error”:{“code”:”FlowMissingConnection”,”message”:”The flow is missing a connection for api ‘<null>’. Reauthenticate the connection or remove from the flow and re-save.”}}”. Code: 0x80060467 InnerError: ‘.

Now we are getting somewhere. Deleting the send an email and re-adding it doesn’t help. The only way I managed to make this work is add a second flow but do not use copy paste to create the send an email action in the second flow.


Discover more from SharePains

Subscribe to get the latest posts sent to your email.

Related Posts

3 thoughts on “Request to XRM API failed with error, the flow is missing a connection for api ‘‘

  1. Hi Peter,
    You article didnโ€™t work for me but prompted me to find the solution that did. In the Email action in Power Automate if I click on the 3 dots to the right ( where you will find peek code) I also found the other connection references. A couple of my emails had the wrong connection reference which I changed and my pain went away.

  2. For anyone seeing this error while importing their solution. This appears to also occur when you upgrade your solution and add an action that is new to the flow, with a new connection reference in the solution. My gut feeling says it occurs because the connector being referenced is not correctly bound in some shape or form. If you go into the connection tab and reauthenticate the connection associated with the connector+ try to turn the flow on afterwards it will work.

    One time i had to attempt reauth it twice before it worked. This works for both unmanaged solutions and managed solutions

Leave a Reply

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