Vadim Tabakman

If you schedule a Nintex Workflow on the last day of the month and set it to run monthly, you'll find that on the following month, it will probably not run on the last day.  That is because it currently adds 30 days to current date and that's the next schedule.

For some people, that's not what they need.  They actually need it to run on the last day of the month and some specific time (eg. 6pm).

Here is the solution that I have created for this.

Requirements

These are the requirements needed for my workflow (that you can download with the link at then end of this post), to run successfully.

  1. Workflow Constant (text) : NW DB Connection String
  2. Workflow Constant (credential) : Farm Admin Credential

The "NW DB Connection String" is simply the connection string you can get from Central Administration > Nintex Workflow Management > Database setup Connection StringThe "Farm Admin Credential" constant is the credentials that will be used in the web service calls in the workflow.

Workflow Pseudo-Code

Get the next months last day

  This can be done with a SQL Call

The result is the last day but the time is 11:59:59PM

  Perform a date calculation, subtracting the appropriate hours and minutes to get the time we want

Make a Web Service Call to the Nintex Workflow web service, to remove the current scheduled on this list item

Make a 2nd Web Service Call to add a new workflow schedule on this item

Workflow

The SQL query looks like this:

SELECT DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE())+2,0))

You store the result in a DateTime variable.

Execute SQL

This will give us the date of the next months last day.

Now, what we want is for our workflow run at 6pm.  Since the datetime returned has a time of 11:59:59PM, we'll subtract 5 hours and 59 minutes.

Calculate Date

In our dtResult datetime variable, we should now have the last day of next month and have it set to 6pm.

Finally, this workflow will be run on a schedule, so we want to remove the current schedule using a web service call before we add a new schedule to the current item.

Remove Existing Workflow Schedule

Now, we can add the new workflow schedule and we should be good to go.

Add New Workflow Schedule

Downloads

Posted by Vadim Tabakman Thursday, August 30, 2012 11:12:00 AM Categories: Calculate a Date Call Web Service Database Nintex Nintex Workflow
Copyright Vadim Tabakman
Rate this Content 0 Votes

Comments

Monday, April 21, 2014 1:45:03 AM
guru
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

can i remove site workflow and reschedule it again?

Monday, April 21, 2014 9:33:19 AM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Guru,

yes of course you can remove a site workflow and you can also remove a schedule, then re-add them if you want.

cheers,

Vadim

Sunday, June 15, 2014 4:17:59 AM
sai krishna
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

I have a problem to schedule a workflow i.e, there'll be a decision box in the workflow and depending on the decision i.e, YES or NO i need to schedule it for every 12 months or every 3 months depending on YES or NO.I know that we can schedule a workflow  for only one time period  but how can we can we schedule it in two different time periods in a single workflow??can u please help me regarding this issue..

Or else we should use loop concept to achieve this.If Yes then how can i achieve it.A detailed explanation will be more helpful?

Thanks,

sai

Sunday, June 15, 2014 8:31:39 AM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi sal,

My personal preference is to have a single scheduled workflow that runs once a month and every time it runs, it queries some list item that tells it whether the rest of the workflow should continue or not.

Alternatively, if you have a workflow run on an item that was created, then you can use a Start Workflow action in this workflow.  This action lets you schedule a workflow.  Maybe you could do it this way also.

Cheers,

Vadim

Thursday, June 19, 2014 12:38:34 AM
sai krishna
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

Thanks for your help and you gave me reply very fast.That's nice of you..

It's working like a charm.

Thanks,

sai

Friday, June 20, 2014 4:10:51 AM
sai krishna
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

I am facing an issue with the server time which is 9hrs lagging with the local time.So how can we change the server time to local time so that it'll will not affect the workflow process and the site which is operating in different country.

I'm using start workflow to schedule the workflow for a time period of every 3 months to repeat.so kindly help me in this issue

Thanks,

sai.

Friday, June 20, 2014 7:38:54 AM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Sai,

There's a Calculate a Date action.  Use that to take 9 hours away from the time you're working with and store that in a variable.  Then use that in the Start Workflow action.

cheers,

Vadim

Saturday, June 21, 2014 10:01:49 AM
sai krishna
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Thanks for your reply.I know about that function as i am a beginner in nintex WF i couldn't figure it out on how to use it.

Will you please give me a detailed explanation on how to do it or else share me any doc regarding it so that i can perform my task in a better way.

Please do the needful at the earliest.

Thanks,

sai.

Monday, June 23, 2014 11:11:17 PM
upender
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

We have a scenario in which we are scheduling one workflow(using start workflow action) and calling another workflow through the first one. Now we need to pass the ID to the second workflow from the first workflow. The first workflow is being initiated on the item creation and hence it is getting the ID.  Do you have any idea how we can pass this variable to the second workflow through nintex?

Thanks,

upender.

Thursday, April 23, 2015 7:14:40 AM
Michael
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

is there also a version for Nintex Workflow 2013 available?

Thank's!

Thursday, April 23, 2015 7:15:45 AM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Michael,

have you tried importing this into NW2013?  It should work.

cheers,

Vadim

Thursday, April 23, 2015 7:30:19 AM
Michael
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

it works.

Tuesday, May 19, 2015 1:20:45 PM
Jeff
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim,

I have a similar issue with regards to using a date in my workflow. I am creating a workflow that will send a reminder email to employees on a certain day every month until the job is completed, lets just pick the 20th. I cant figure out how to set up my workflow to send on the 20th of every month. I am still learning the many bells and whistles that Nintex offers, so any help would be greatly appreciated.

 

Many Thanks,

Jeff

Tuesday, May 19, 2015 2:32:48 PM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Jeff,

That's an interesting request.  Easiest, would be to have a workflow that is scheduled to start each month, on the 20th, and look for outstanding tasks that it knows about and then sends off reminders.

The other way, would be to get your workflow to figure out a date control that has the next 20th of the month, go into a Pause Until action, and then send our reminders. I think this is a little bit harder to do.

cheers,

Vadim

Wednesday, May 20, 2015 6:48:40 AM
Jeff
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Vadim,

 

I will give the first suggestion a shot. Our Farm doesn't work well with Pause and Wait nodes, but the first suggestion sounds great. Thank you.

Jeff

Thursday, June 11, 2015 7:05:46 AM
Dan
Gravatar

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Vadim

 

We have a problem in making a workflow send an email at specifically 11.00 AM every day.

Is there a quick fix for this using Nintex workflows?

Thursday, June 11, 2015 10:17:18 AM

re: Nintex Workflow - Scheduling a Workflow at the End of the Month

Hi Dan,

what kind of problem?

Do you get an error?

Is the workflow scheduled?

Is the schedule not running at the correct time?

cheers,

Vadim

You must sign in to this site to post comments.
Already Registered?
Sign In
Not Yet Registered?
Register

Statistics

  • Entries (279)
  • Comments (1769)

Categories