Allow for scheduling flows every nth business day
See original GitHub issueCurrent behavior
We would like to schedule a flow to run every fourth business day - as @jcrist has already confirmed, there is no way right to now to implement this currently using the available prefect scheduling utilities (Interval clocks + filters + adjustments … ).
Our use-case is we need to consume certain financial reports that get published on a 4th business day lag every month, I would assume others working in the financial industry might face a similar problem, where they need to act on the data as soon as it is made available …
Proposed behavior
The simple workaround is to have a custom is_nth_business_day
filter which should resolve this.
Example
flow.schedule = Schedule(
# fire every day
clocks=[IntervalClock(days=1)],
# but only on the 4th business day
filters=[
is_nth_business_day(4),
],
)
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to schedule a flow on the X business day of each month?
Example, Schedule a notification to go out on the 8th business day of the month (ignoring weekends and holidays)
Read more >How to run a scheduled flow on business days?
Run the scheduled flow every day; Use a decision block as the first element to decide if the rundate is a business day....
Read more >Weekday scheduling of Power Automate flows - Amey Holden
The recurrence schedule allows you to define what days of the week your flow runs - its not the most intuitive to find....
Read more >Solved: Scheduled Flow on Workdays - ServiceNow Community
Create the flow with a "Daily" trigger, running every day at your desired time, then as the first action, check if the time...
Read more >Schedule-Triggered Flow Considerations - Salesforce Help
A schedule-triggered flow starts at the specified time and frequency. You can't launch a schedule-triggered flow by any other means. The Start Time...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry @jcrist - just reading this, I was asking for the 4th business day of every month … so I suppose I could make use of DatesClock as @cicdw is suggesting … (I am sorry I wasn’t aware of this option - should have read the documentation)
Just to jot down the thought while I have it, you could probably use the
pandas
time series handling to generate the list of dates to pass into theDatesClock
which offloads the complex date handling to something built for it but prevents us from having to require it.