cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Schedule Flow After Hours

Hi, 

We have an application called pagerduty that we use to setup our After-hours alerts. Basically, when we receive an email after-hours it has to be forwarded to a pagerduty email (pagerduty takes care of the alerts after it recieves the email).

As of now, I want to trigger a scheduled flow with 1-minute recurrence. Let's call it After-hours flow.
So this After-hours flow checks for any incoming new emails every 1 minute that we receive and then forward them to pagerduty email. But this flow should only be functioning only after-hours. Now, my problem is to make this 1-minute recurrence flow stop working during business hours (monday-friday 8:30AM to 5:30PM). I'm thinking if there is another flow that I can setup to stop and start this "After-hours" flow based on business hours schedule. 


1 REPLY 1
Highlighted
Solution Sage
Solution Sage

Re: Schedule Flow After Hours

Hi @harish ,

I suggest you add a condition after the 'when a new email arrivers'.

 I have made a test on my side, please take a try with the following workaround:

The Compose action is to get the Received Time of email:

formatDateTime(triggerBody()?['DateTimeReceived'],'HH:mm:ss')

The expressions in Condition are:

1.

dayOfWeek(triggerBody()?['DateTimeReceived'])  is equal to 0, Indicates that the time is Sunday.
2. 
dayOfWeek(triggerBody()?['DateTimeReceived']) is equal to 6, Indicates that the time is Saturday.
3 and 4
greaterOrEquals(outputs('Compose'),'08:30:00')  is equal to false
lessOrEquals(outputs('Compose'),'17:30:00') is equal to false 

Capture3.PNG

Best Regards,

Community Support Team _ Zhongys

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,488)