This topic was automatically generated from Slack. You can find the original thread here.
Hi everyone… Not sure, if this has been answered before but since I cannot find the information thus posting here for help
I have created a scheduled trigger to execute a python script. However, the schedule is using a CRON expression. When i enter the CRON expression, it shows me exactly the date and time I want the trigger to be executed but I cannot find the option to save it.
This is what my CRON expression looks like but no option to Save and Continue
thanks for that suggestion. removed W and it worked. This is strange… Even when PD is showing it is recognizing this CRON format, it is seemingly not saving it…
unfortunately LW isn’t a part of the standard Unix cron spec and so it’s not well-supported in all libraries. The lib we use in our scheduler doesn’t accept LW, but the JS lib we use in the frontend does, which is why you see this mismatch. This is on our backlog to address.
In the meantime, can you do something like 0 8 28-31 ** **? Then in a JS / Python / bash step, you can check to see if it’s the last weekday of the month and exit early if not. 28-31 should cover all the cases for the last weekday (thanks to ChatGPT for outlining the logic):
• February (in non-leap years) ends on the 28th. If the 28th is a weekday and the 29th doesn’t exist, you’ll need to check on the 28th.
• February (in leap years) ends on the 29th. If the 29th is a weekday and the 30th doesn’t exist, you’ll need to check on the 29th.
• For months ending on the 30th, you’ll need to check if the 30th is a weekday and if the next day is a different month or a weekend.
• For months ending on the 31st, you’ll need to check if the 31st is a weekday and if the next day is a different month or a weekend.
Of course you may also want to cover holidays and such, so doing this in a full-fledged programming environment may make it easier to implement the logic you want at the expense of a handful of extra credits every month to run the Pipedream workflow.
Alternatively, you could trigger on the first of the month (or whenever), write some code to identify the last work day of the month, and just delay/suspend the workflow until then.