Power Automate: stop a workflow after a specific day

Flows should not run indefinitely, instead to stop it manually, do it automatically by adding a condition and the “turn off flow” action. Click to the “+” then put “condition” to select:

power automate

In its configuration, click on the first “choose a value” field then on “fx”:

power automate

Put “utcNow()” then click on “add”:

power automate

For the middle fields, select what fit best for you. For my example, I will select “is greater than”:

power automate

Then in the second “choose a value”, put:

YYYY-MM-DDTHH:MM:SS.000Z

power automate

NOTE:

  • Change YYYY-MM-DD and HH:MM:SS by yours
  • Hours are in UTC so for instance, if I want my flow to stop at 22 CET, I will put 20 since there are 2 hours of difference between CET and UTC

Click on the “+” of “true”:

power automate

Put “turn off flow” to select:

power automate

Just fill up the fields:

power automate

NOTE:

  • The “environment” is the one where is located your flow that you want to stop. You will find it at the top right
    power automate
  • If actions are outside of “condition” (before and/or after), they will be executed even if you put an end date 1 year before, if you don’t want that, put actions inside “false”

Interesting Topics