web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Very slow and intermit...
Power Automate
Answered

Very slow and intermittent error 520. x-ms-failure-cause apihub-token-exchange

(0) ShareShare
ReportReport
Posted on by 212

Well after having a very good flow day, I had a very bad flow day.

 

Out of nowhere, my epic flow suddenly goes from taking 1 minute to run to taking half an hour. All of the SharePoint flow actions are complaining about retries, and sometimes working and then sometimes failing. Eg an action that has 2 timeouts in one run with take a second or two on the next run...

 

The error I consistently see in the retries and errors is:error 520. On a retry I will see something like:

 

Duration: 43s
Start time: 2018-03-07T11:08:14.7908465Z
End time: 2018-03-07T11:08:58.136289Z
Status: 520
Client request ID: 20ac3a99-ef97-4f8f-9aee-3e603e0fa8d8

 

When it fails alrogether, I see. x-ms-failure-cause apihub-token-exchange in the header and in the body I see:

 

{
  "Message""Error from ASE:token exchange failure."
}

 

The issue is definitely in the connections, because for a while PowerApps was also very slow to connect to SharePoint connections too, with occasional errors. 

 

So to troubleshoot, I tried to re-auth my SharePoint connector and it made no difference. I tried to share the flow with a different account, and I then edited the flow and changed the connections on SharePoint tasks to run as that account. While the flow editor worked fine and happily saved the flow, this resulted in the flow breaking altogether with:

 

'The template language expression 'json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['shared_sharepointonline_1']['connectionId']' cannot be evaluated because property 'shared_sharepointonline_1' doesn't exist, available properties are 'shared_sharepointonline, shared_onedriveforbusiness'

 

Foiled by that approach, I exported the flow and then imported it while logged in as my second account and while it happily imported, I was unable to connect it to PowerApps. That gave me a registration error.

 

Can you confirm if there are known issues happening at present?

 

Paul Culmsee

Categories:
I have the same question (0)
  • paul_culmsee Profile Picture
    212 on at

    Made a new test flow, logged in as my alternate account... same issue. This would suggest its not a specific account thing on this tenant... 

     

    issue.PNG

  • Verified answer
    paul_culmsee Profile Picture
    212 on at

    An update... this flow has several SharePoint Get Items and Get FIles actions. At some point the oData filters on those actions were wiped, meaning they were dealing with large lists and not the small subsets they were supposed to... 

     

    Weird that 5 of these actions would lose their config.... but anyway. after correcting this, things seems better. The flow in my second reply also started going back to running quickly, so I think I had a couple of issues going on...

     

    Paul

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard