Hi Team,
I need Last working Day date of every month as i need to start process for every month Last working day.
Let's say if i take Aug-2025 Month & its month end date is 31st & falls on Sunday but in my case process should trigger on 29th Aug which is a last working day.
I need dynamic approach so that it iwll pick last working date & start process.
prompt response really appreciated,Thanks
Discussion posts and replies are publicly visible
Create a process model with a Timer Start Event set to run daily. Connect it to a Script Task that checks if today equals the last working day using below expression. Add an XOR Gateway that routes to your monthly process when isLastWorkingDay is true, or to an End Event when false. By using this expression you can find last working day of every month.a!localVariables( local!lastDay: eomonth(today(), 0), local!dayOfWeek: weekday(local!lastDay), local!lastWorkingDay: if( or(local!dayOfWeek = 7, local!dayOfWeek = 1), if(local!dayOfWeek = 7, local!lastDay - 1, local!lastDay - 2), local!lastDay ), local!lastWorkingDay )
a!localVariables( local!lastDay: eomonth(today(), 0), local!dayOfWeek: weekday(local!lastDay), local!lastWorkingDay: if( or(local!dayOfWeek = 7, local!dayOfWeek = 1), if(local!dayOfWeek = 7, local!lastDay - 1, local!lastDay - 2), local!lastDay ), local!lastWorkingDay )
What if the last working day e.g Monday is a holiday?
https://appian.rocks/2023/07/03/the-working-time-problem/
This might help you finding the closest working day.
You can use below expression
a!localVariables( /* Replace with your own holiday list or a rule that fetches them dynamically */ local!holidays: { date(2025,8,15), date(2025,8,28) }, /* Get the last calendar day of the current month */ local!lastDay: eomonth(today(), 0), /* Calculate last working day by moving backwards 1 workday from lastDay+1 */ local!lastWorkingDay: workday( local!lastDay + 1, -1, local!holidays ), local!lastWorkingDay )
Hi Shubham Aware , I believe, we can mention the holidays & weekends on the process calendar and use function calisworkday().
It is easy to maintain, with holidays stored in a database so end users can update them anytime without developer involvement. It is highly flexible, supporting multiple regions by simply passing different holiday lists. This method is portable across environments, works instantly without extra setup.