Hi all, i figured i would share this with the community in case it would help out someone as other posts here helped me figure out some stuff for my first production flow successfully running.
It's super simple but a bit crude (you have to either readjust to daylights savings time or widen the range) and doesn't use any calendars from your company at least as written. Follow these simple steps but please read the full post as there is a drawback with using this approach.
1. Create a condition step.
2. On the "no" branch, add the action "Terminate" (which should be easier to search for).
3. Leave the "yes" branch blank and put any actions after it.
4. In the condition step, click on "edit in advanced mode" and enter the following:
@and(
or(equals(dayofweek(addhours(utcnow(), -6)), 1),
or(equals(dayofweek(addhours(utcnow(), -6)), 2),
or(equals(dayofweek(addhours(utcnow(), -6)), 3),
or(equals(dayofweek(addhours(utcnow(), -6)), 4),
equals(dayofweek(addhours(utcnow(), -6)), 5))
)
)
),
and(greaterOrEquals(int(formatDateTime(addhours(utcnow(), -6),'%H')),8),
lessOrEquals(int(formatDateTime(addhours(utcnow(), -6),'%H')),19))
)
5. Adjust the above -6 (which is currently central time), and the hours [the 8 and 19 at the bottom expression]. The times are in 24 hour notation.
6. Add another "or" clause in the dayofweek area if you need to add Saturday. The 1-5 is M-F. Sunday is 0 and Saturday is 6.
Now to the two critical details. With the workflow written like this, you will want to kick it off as a recurrence. You can set it to run just daily (day for unit and 1 for each day) but this is really written as is for hour increments. I myself set it to every 2 hours. The problem with having it run every hour or even two, it does start to eat at your free flow quota pretty quickly. Here is the approximate number of flows from your quota per month if you need to decide how important it is.
Every hour: 720
Every two hours: 360
Every three hours: 240
Every four hours: 180
Every eight hours: 90
Keep in mind as you go to more time between, depending on what you have your start time set to, you can actually start missing frequency pretty badly. Also, I highly recommend for most people, set a start time in the advanced recurrence to start at an off hour. So start it at 2017-05-05T20:10:00Z instead of 2017-05-05T20:00:00Z for instance.
I hope this helps someone, good luck on your flow adventures.