How-to-fix: Could not find any valid connection for connection reference / InvokerConnectionOverrideFailed
Connection handling in Power-Automate is sometimes a challenge, especially when you change a connection later. I encountered today the following error after I switched a Power-Automate flow to a service account:
{
"error":
{
"code":"InvokerConnectionOverrideFailed",
"message":"Could not find any valid connection for connection
reference name 'xxx' in APIM header.",
"messageTemplate":"InvokerConnectionOverrideFailed"
}
}
The problem behind this error is a typical credentials caching conflict. The InvokerConnectionOverrideFailed error occurs when Power Automate tries to swap the runtime context to use the app user's credentials (the "Invoker"), but the system cannot find, validate, or map a matching connection token.
However, other factors can also cause this error:
- Expired or Stale Cached Tokens
- Connection Dependency Disconnect
- The First Run Requirement
The first one occurs because Power Apps and Power Automate cache connection definitions and security tokens to speed up performance. If a password changed, an MFA token expired, or a session timed out, the cached reference breaks.
The second one can happen when you trigger a flow from Power Apps; the app passes a connection reference to the flow. If the flow is edited, cloned, or imported via a solution, the internal GUID (unique ID) mapping between the App, the connection reference, and the actual connector can break, causing the app to look for a token that no longer exists.
The last one can be observed when a flow is set to use "Provided by run-only user" (Invoker); the very first time it runs under that context, it needs an explicit manual trigger to pop up the OAuth permission window. If a user triggers it automatically without ever granting that initial permission, the system fails to fetch the override connection.
In my case, the error comes up after I change the connection to a service account. But don't worry, it is very easy to solve this issue. Just open your Power-Automate flow and go to "Test". Use "Manual" and start the test. Next, the typical confirm connection dialog will be shown. Agree on the connection, and everything should be working 😎.
Kommentare