question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow for scheduling flows every nth business day

See original GitHub issue

Current 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:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
marwan116commented, Oct 14, 2020

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)

0reactions
madkinszcommented, Oct 28, 2020

There is a lightweight way of achieving this today, and a way we could make it more configurable in the future:

I don’t see how this gets every 4th business day, but maybe I’m misunderstanding the request. If the request was for the 4th business day of every month or of every week, I see how that would work, but not every 4th business day.

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 the DatesClock which offloads the complex date handling to something built for it but prevents us from having to require it.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found