Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Trigger the workflow every last day of the month

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I need a workflow to run every last day of the month. Here is the link where it is described how to schedule recurring workflows, but in the example it creates workflow which will work every month (started counting from first manual trigger).
How can I do this  for the last day of the month? If I will manually trigger it on 30th day of the week, and next week will be 31 days, the workflow will be still triggered on 30th day again..
Every help will be much appreciated.

*This post is locked for comments

  • Marx2020 Profile Picture
    Marx2020 173 on at
    RE: Trigger the workflow every last day of the month

    If you use a modern flow (Power Automate), you can create a workflow to run at (say) 11pm each day.  Within the workflow, set two variables - start of month (inbuilt function startofmonth) for today, and using addDays (1) calculate the start of month for tomorrow's date.  Create a condition to run your process only if the second variable (start of month for tomorrow's date) is greater than the first variable.

    pastedimage1637025077087v1.png

    Hope this helps if anyone is looking to solve a similar problem.

    Steve.

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Trigger the workflow every last day of the month

    Try something like this:

    month.png

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Trigger the workflow every last day of the month

    Hi

    To answer your questions- No, there isn't any configuration/ customization to do this without code. However there are some custom workflow utilities (which are again built using code) which you can try. So don't need to write any code for this, so just have to download the solution contains the utilities.

    Same link which I shared above: github.com/.../CRM-DateTime-Workflow-Utilities

    There is a step which returns "Get Month Start/End Dates" so this is something you can try.

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trigger the workflow every last day of the month

    In that case it will not work properly and will not work only on the last day of the month.

  • Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Trigger the workflow every last day of the month

    You can run your Workflow in each 30 days if you do not want to code.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Trigger the workflow every last day of the month

    I just need to know is there way to do this without any code. Like in that blog it is written timeout 1 month (where one month is not 30 days, it depends which month it is). To do like this (1 month - 1 day) somehow and start this workflow at 1 day of the month, so other processes will be done 1 day earlier :)

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Trigger the workflow every last day of the month

    Hi,

    I don't think there is any straight forward way to run a workflow on the last day of month. You need to write custom code for this to get the exact date i.e. 30, 31 or 28 and then use that instead.

    The other option is to check if you can use  github.com/.../CRM-DateTime-Workflow-Utilities

    Hope this helps.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Trigger the workflow every last day of the month

    Hi,

    I would suggest you to create a console application and execute the workflow using ExecuteWorkflowRequest. After that, using task scheduler to schedule the console application.

    docs.microsoft.com/.../gg307964(v%3Dcrm.8)

    if you have Microsoft Flow

    docs.microsoft.com/.../run-scheduled-tasks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,979 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,848 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans