How to bypass the expiration limit in Power Automate – UPDATE

2 years ago, I wrote about how to re-enable a flow after it has been automatically disabled because it hasn’t been running for 60 or 90 days.

For the last 2 years, this worked flawlessly. But today, my flow failed.

In this short follow-up post, I will explain how to fix this.

Why did it stop working?

Microsoft loves changing things around and so they did. In the previous email that was send to the owner of the flow (subject: Alert! Your flow has been turned off since it was not running), the URL behind the ‘Go to my flow‘ button was just a simple string like this:

https://flow.microsoft.com/manage/environments/<ENVIRONMENT ID>/flows/<FLOW ID>/details/...

from which you could easily extract the Environment ID and the Flow ID.

But now, Microsoft has decided to change the format of that URL with encoded characters, like this:

https%3A%2F%2Fflow.microsoft.com%2Fmanage%2Fenvironments%2F<ENVIRONMENT ID>%2Fflows%2F<FLOW ID>%2Fdetails%2F...

So now, we cannot identify the Environment ID by splitting on the ‘https://flow.microsoft.com/manage/environments/‘ string.

Also, Flow ID cannot be identified anymore by splitting on ‘/flows/‘.

How to fix this?

Luckily, the solution is quite simple. You can add an action above your Initialize variable actions in which you replace the %3A character back with ‘:’ and the %2F character with ‘/’.

In my case, I added a Compose action with the following expression:

replace(
	replace(
		triggerOutputs()?['body/body'],
		'%3A',
		':'
	),
	'%2F',
	'/'
)

This replaces all occurrences of ‘%3A’ and ‘%2F’ in the body of the email with ‘:’ and ‘/’ so you will have a normal URL again.

After this, you simply replace ‘triggerOutputs()?[‘body/body’]‘ in the expressions of both your Initialize variable actions with the Dynamic content reference to your compose action and your flow should be working fine again!

Future

Keep in mind that Microsoft is still in the transition from the old Microsoft Flow URLs to the new Power Automate URLs.

So there is a chance that in the near future, this flow configuration must be altered again, because it is still using the old Microsoft Flow URLs in the notification email.

6 Replies to “How to bypass the expiration limit in Power Automate – UPDATE”

  1. Hi Tried all the above, and still not working.

    I receive the following error in turn on flow

    Bad Request

    Bad Request – Invalid URL
    HTTP Error 400. The request URL is invalid.

    0
    0
    1. Have you seen the update stated on top of this blogpost? The URLs have changed since I wrote this article, so please have a look at the link on top of the article that explains which URL to use

      0
      0
  2. Thanks for your contributions. It was working really well until microsoft changed it.

    I saw your article too and I updated it again as you stated. But I keep getting errors. Can you give an idea?

    The error I get is;
    (BadRequest)

    Bad Request

    Bad Request – Invalid URL
    HTTP Error 400. The request URL is invalid.

    I made the changes as you mentioned in my flow.

    1. Variable

    first(
    split(
    last(
    split(
    triggerOutputs()?[‘body/body’],
    ‘https://flow.microsoft.com/manage/environments/’
    )
    ),
    ‘/’
    )
    )

    2. Variable

    first(
    split(
    last(
    split(
    triggerOutputs()?[‘body/body’],
    ‘/flows/’
    )
    ),
    ‘/’
    )
    )

    I couldn’t upload a picture here. If you want, I can send you a photo by e-mail. Or I can create a topic to the microsoft community and send the pictures from there. Thanks in advance.

    0
    0
    1. Thanks for the feedback. I just added an additional remark in the original blogpost, referring to the new blogpost to make sure others will find it easily as well.

      0
      0

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

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