Skip to main content

Notifications

Power Automate - Building Flows
Answered

Send a message to say how long a flow how long the flow took to run

(0) ShareShare
ReportReport
Posted on by 252

Hi All,

 

Is it possible to add a message at the end of a flow to say the duration time of the flow? 

For example the message might say,

 " X Flow took 3 mins to complete"

  • Skybluekid Profile Picture
    Skybluekid 252 on at
    Re: Send a message to say how long a flow how long the flow took to run

    Thank you @annetoal .  This very useful

  • Verified answer
    annetoal Profile Picture
    annetoal 1,933 on at
    Re: Send a message to say how long a flow how long the flow took to run

    The simplest way might be to store the time at the beginning and again at end of the Flow, then subtract the finish time from the start time. Here's an example that calculates the tenths of a second between start and end of execution and then sends a mail:

    annetoal_1-1685050610091.png

     

     

    I used compose actions to illustrate the basic concepts. You might find other actions are better choices in your Flow.

    The Start and Finish actions:

     

     

    ticks(utcNow())

     

     

    The Compose action represents where you would put all your Flow steps.

    The tenths of a second compose:

     

     

    div(sub(outputs('finish'),outputs('start')),1000000)

     

     

    Then the Send an email action takes the output from the tenths of a second compose action

     

    workflow()?['tags']?['flowDisplayName'] took outputs('tenths_of_a_second') tenths of a second to execute.

     

    and puts it into a mail. 

    I used tenths of a second here because this is a short Flow and it's not going to take long to execute. You might find other intervals more suitable.

    To learn how to calculate other intervals (day, week, month, etc.), read this:

    Solved: how to get difference between two dates in flow - Power Platform Community (microsoft.com)

     

    If this helped, please mark it as a Solution.

    Anne

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard