13

Is there a simple or OOTB way in SharePoint to trigger a workflow to execute daily? Maybe through the use of timer jobs? My goal is something that doesn't require the use of a solution or some type of managed code.

UPDATE

My goal for the use of daily workflows is largely to send email notifications based on dates. My company has many lists that contain expiration dates for certificates and certifications, and individuals need to be notified when the date is approaching and/or has arrived. I've been trying to use list alerts, but they simply don't have the flexibility and options I need.

I'll use a solution if there is no other option, but I don't like adding extra components if I don't have to.

4
  • Can you describe what your workflow will do? Why would you not want to use a solution package?
    – Lori
    Commented Jul 11, 2011 at 15:39
  • Lori, I updated my post in response to your question. Commented Jul 11, 2011 at 15:58
  • You use SP 2010 or 2007? Commented Nov 16, 2011 at 7:06
  • We use SharePoint 2007 Commented Nov 16, 2011 at 15:15

7 Answers 7

13

I think this post over on SharePointMag may be what you are looking for.

EDIT

Summary of Article

This looping workflow has one choice to make among three options each time iterates:

  1. Is the task complete? If yes, quit. Yeah, we’re done!
  2. Is this the first time I’m sending a reminder? If yes, send a reminder and pause one day. Set a flag to indicate that the first reminder has been sent.
  3. Is the second or more time I’m sending a reminder? If yes, send it and pause one day. Increment a counter to indicate how many reminders have been sent.

(Developer readers here may be thinking to themselves that these seem a lot like states and/or state transitions. You’d be correct to think that.)

Pre-Configuration To support a design like this, we need to add two columns to our task: 1. FirstEmailReminderSent 2. EmailReminderCount

The workflow uses these fields to maintain some information about the task (e.g. was an email reminder sent) as well as to trigger the workflow to run again for subsequent reminders.

It’s important to set the default value of FirstEmailReminderSent to “No”. EmailReminderCount is simply an number with default value of zero.

With this configuration work complete, let’s see all of this in action by creating a workflow.

Firing up SharePoint Designer, we create the workflow in the normal way (i.e. open up the site with the task list, create new SharePoint content, create a workflow).

The workflow has been named “Daily Reminder,” it’s associated with a list called “Tasks” (i.e. the task list) and here is the key: It’s set to run both when the task is created and when it’s changed. The “whenever an item is changed” bit is very important, as we’ll see later. This setting enable us to leverage SharePoint’s remorseless nature to our benefit.

The first step of the workflow is easy: Stop running if the task has been completed: The second step is more interesting. This step, labeled “Send Initial Email,” obviously sends the first email. However, it also sets up the subsequent reminder.

Note that this task only runs if our task column, “FirstEmailReminderSent” is equal to No. Since we were careful to specify “no” as this column’s default value, we know this step will run (provided that we got past the first step above).

  • First, we send the reminder email.
  • Then, we set FirstEmailReminderSent to Yes. This ensures that this particular step never runs again.
  • Next, we pause for one day.

Once our pause completes, we want to start looping. We do this by “poking” the task by changing any field of the current item. When we do this, from SharePoint workflow’s perspective, the item has been changed. Since we checked “Automatically start this workflow when an item is changed,” it starts the workflow all over again. We could pick any field but since we need to “poke” the current item, we may as well derive some business value at the same time. We’ll use the EmailReminderCount field. This way, we can poke it and know how many times the reminder has been sent, killing two birds with one stone.

  • First, we create a workflow variable
  • Copy the current value of EmailReminderCount to our TemporaryCounter variable using the “Set Workflow Variable” action
  • Use the “Do Calculation” action to increment this by one.
  • Finally, update the Task’s EmailReminderCount using the “Update Field in Current Item” action.

The third and final step looks very similar to the previous this step only runs if the task was not marked as completed and if the first email reminder has already been sent.

Workflow pauses for a day and then increments the EmailReminderCount by one. Performing this update causes the workflow to start over again. Assuming the user never marked the task as complete, SharePoint workflow skips the first steps (since task is not completed) and the second step (since FirstEmailReminderSent is still Yes), landing back here on the third step. It sends the email and pauses 24 hours, pokes itself and keeps looping like this, forever, until the task is completed or it’s deleted.

3
  • What do you believe the performance impacts associated with a solution such as this would be?
    – Michael A
    Commented Jul 5, 2012 at 7:44
  • 1
    No clear cut answer to that. It depends on your configuration and how many instances of the workflow are running. MS has a capacity planning article for workflows that may assist you: technet.microsoft.com/en-us/library/gg508755.aspx Commented Jul 6, 2012 at 14:25
  • I have followed your guide to create the daily trigger of the workflow. Unfortunately, If I change the value of the emailreimdercount than it triggers the workflow and I receive the email, but the automatic filed update, altough it updates the emailremindercount field, does not trigger the workflow. Can you pls help? Tx Conrad
    – user10963
    Commented Sep 26, 2012 at 11:01
1

I have 5 years of experience in SP customizations / workflows and I needed to develop a daily workflow. None of these "workflows calling workflows" methods work for long periods of time or after a catastrophe. The only really enterprise way to do this is to use Information Management Policy with Expiration and a mirror list where items are deleted and maybe recreated every day.

1

I'm not sure this question is still actual for you, but it could be helpful for others.

I recently wrote the blog post: How to send bulk e-mail with attachments to external users using SharePoint 2013/Online workflow

I think it is just what you were looking for to send e-mails, but regarding scheduling, I use there list level workflow. You can implement the same logic for site level workflow and schedule it using SharePoint Workflow Scheduler. It is paid tool for scheduling workflows developed by my team.

1

I'm sure you found a solution by now but this post is most helpful: http://www.attunix.com/about/blog/2013/october/17/sharepoint-2010-daily-reminder-loop/.

I used it as a basis to get reminder e-mails when an item is 3 days from due date and 1 day from due date, along with notification for new items, item changes, and item closure.

0

Theoretically (and actually) it is possible to create scheduled jobs that will perform these tasks for you and to set them up and run them from the SharePoint server. However, this is not generally a best practice as it can only be done on a single server in a farm and can be that single point of failure. It is much better to consider a solution that will deploy and run on a loop every 24 hours or something like that, then you are able to ensure that this is deployed farm-wide and would be able to monitor it through timer jobs or other monitoring components.

2
  • Is the idea to create a solution for each workflow trigger? Alternatively, are you aware of a solution that creates some type of interface to trigger workflows routinely? Commented Jul 11, 2011 at 17:49
  • Not necessarily. It would really depend on how you create your solution. You could create it for a particular type of list or library or by content type if things are standardized throughout your organization.
    – Lori
    Commented Jul 11, 2011 at 18:23
0

There is no loop construct in a SharePoint Designer workflow, so you would need to keep triggering your workflow to start again each day. One way to do that is to set your workflow to start whenever an item is changed. So, at the end of your workflow pause for a day, then modify a column in your list, which will cause it to restart.

NOTE: WSS 3.0 now will not retrigger a workflow when the item changes. You will need to create 2 alternating workflows to make this happen. (I believe it was Service Pack 2 to WSS 3.0 that made the change, but I may be wrong)

1
  • There are in third party workflow solutions have looping. Also, as a point of clarity in your example, you'll need 2 workflows to pull that off since workflows can no longer trigger themselves. Commented Jul 12, 2011 at 15:38
0

Recently I found myself in the scenario, that send mail using SharePoint Designer when when an item is modified by one of the users from the given list. After Googling it on internet I found this blog which was very helpful.

Summary:

In such scenario, instead of selecting People/Group from SharePoint site, select workflow lookup for a user, Select The list where users are added as a data source.

Not the answer you're looking for? Browse other questions tagged or ask your own question.