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 / How to restart flow wh...
Power Automate
Suggested Answer

How to restart flow when trigger happens before flow ends

(1) ShareShare
ReportReport
Posted on by 6
Hello community,

I'm completely new to Power Automate. I started my first workflow yesterday and got it working to a certain extent today, but now I'm stuck.

My current workflow in Outlook is shown below and works like this:

1) Check email received
2) If an email body contains the text "Start Process" --> (this is the Trigger)
3) The workflow waits 30 minutes
4) When 30 minutes have elapsed, sends 3 emails (1 email every 5 minutes)
5) After sending the 3 emails, the process ends and restarts if it receives the Trigger again.

What I want to do is modify it so that if it receives the Trigger before it finishes sending the 3 emails, it stops the previous
process and restarts the workflow. In other words, if 30 minutes have passed and the workflow has sent the first email and
receives the trigger before sending the second or third email, I want the previous workflow to stop and restart the 30-minute
countdown to send the 3 email again.

I'm not sure if I'm explaining myself clearly. How can I do this? I'm using Office 365.

Thanks in advance for any help.
 
Categories:
I have the same question (0)
  • Suggested answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 1 on at
    ​Hi @CU04060001-0,

    Yes, your requirement makes sense. What you need is a restartable timer pattern.
    Power Automate does not normally let one running flow instance directly stop a previous running instance when a new email arrives. The common workaround is to store a “current run ID” somewhere, and have each running instance check whether it is still the latest one before continuing.
     
    You can do this with a small SharePoint list, Excel table, or Dataverse table.
     
    Create a table with columns like:
    Key
    CurrentRunId
    LastTriggerTime
     
    In the flow, when a new email arrives, first check whether the email body contains the text “Start Process”. If it does, create a variable called something like MyRunId and set its value to guid(). Next, save this value in your SharePoint list as the latest CurrentRunId. After that, add a delay of 30 minutes. When the 30-minute delay has finished, read the SharePoint item again and compare the stored CurrentRunId with the MyRunId value from the current flow run. If the two values are different, it means that another trigger email arrived after this flow started, so this flow should be terminated. If the two values are the same, then the flow is still the latest run and it can send the first email. After sending the first email, add a delay of 5 minutes. Then check the CurrentRunId again before sending the second email. After the second email, add another 5-minute delay and check the CurrentRunId one more time before sending the third email. This way, if a new trigger email arrives at any point, the older flow run will stop itself before sending the next email.
     
    This means every time a new Start Process email arrives, it writes a new run ID. Any older flow instance will detect that its ID is no longer current and stop itself before sending the next email.

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    SpongYe Power Platform Enthusiast [LinkedIn] | [Youtube| [My blog]

     

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my blog [@SpongYe] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Suggested answer
    Vish WR Profile Picture
    3,748 on at
     
     

    Power Automate doesn't natively let a new trigger cancel an already-running instance.

    The go-to workaround is a flag-based approach — store a timestamp or run ID in SharePoint/Dataverse when the trigger fires. At each step of your flow, check if that stored value still matches the current run. If a newer trigger has updated it, the older run just exits gracefully without sending the remaining emails.

    So the flow would look like:

    1. Email received → write a unique run ID to a SharePoint item
    2. Wait 30 mins → check if the stored ID still matches this run → if not, terminate
    3. Send email 1 → check again → wait 5 mins → repeat
    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
  • CU04060001-0 Profile Picture
    6 on at
     
    I've tried to make it like you suggested me. I've added a table in Excel rith the column names you said and is updated during the flow the values of 
    CurrentRunId
    LastTriggerTime
    I think I'm close. The flow works when receives the initial trigger, but doesn't stop and re initiate when receives
    a new trigger before first flow ends.
     
    I'm attaching the definition.json of my current flow and the flow image in 2 formats.
     
    Thanks for any help.
     
    Regards
    flowFormat1.png
    flowFormat2.png
    definition.json

    Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

  • CU04060001-0 Profile Picture
    6 on at
     
    I'm trying to store a run ID.
     
    I need to set a condition after each step to check is run ID is the same?
     
    How terminate the previous flow?
     
    Regards
  • Vish WR Profile Picture
    3,748 on at
     
    The screenshot is not visible , u can use image upload instread of file atatchment 
  • CC-08062038-0 Profile Picture
    4 on at
     
    Yes, it still shows this message for the files I attached.
     
    "Your file is currently under scan for potential threats"
     
    Well, I've inserted code snippet and flow in 2 different formats. Thanks for any help.
     
     
    Format 1
     
     
    Format 2
     
  • Suggested answer
    SpongYe Profile Picture
    5,909 Super User 2026 Season 1 on at

    @CU04060001-0 thanks for the update. It sounds like you are close.

    Updating the Excel table will not stop the previous flow by itself. The previous flow run must read the Excel row again after each delay and compare the current Excel CurrentRunId with its own local MyRunId.

    Each run should create its own MyRunId using guid() and write that value to Excel. After the 30-minute delay, get the Excel row again. If the Excel CurrentRunId is different from the local MyRunId, terminate the flow. If they are the same, continue and send the first email.


    You need to repeat the same check before email 2 and email 3. Make sure you are comparing against a freshly read value from Excel, not a value stored earlier in the flow.


    Also check that trigger concurrency is not set to 1, because the new trigger must be allowed to start while the previous flow is still running. Otherwise, it will not update Excel in time to cancel the old run.

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    SpongYe Power Platform Enthusiast [LinkedIn] | [Youtube| [My blog]

     

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my blog [@SpongYe] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • CC-08062038-0 Profile Picture
    4 on at
    Hi @SpongYe 
     
    My current flow is creating a new CurrentRunId for each trigger. What I still don't get is what I'm missing to stop the previous flow. 
     
    What action/block should I add in "FALSE" part of the condition? I currently have a "Terminate" block but that is not stopping the previous flow.
     
    Regards

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard