Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Right now I've created a few SharePoint Designer workflows in SharePoint 2007, I need to start them all up for each existing list item at (more or less) the same time. I'm not terribly worried about bandwidth as all of them will be waiting for a certain time to elapse on the list anyways (Pause until X Date and x is different for each item).

However is there a tool out there that can iterate through all the list items in a list and start workflows I specify? Or would I have to code this?

share|improve this question
add comment

4 Answers

up vote 1 down vote accepted

No need to introduce an app written by someone else to do this. It can all be done through the UI.

This is what I do for items I need to process in bulk with a workflow. Create a simple number column that acts as a trigger with a default value of 0. In my workflow, I put in an If trigger column = 1 do what I need it to do.

In datasheet view, I expose the trigger column, set it to 1 and fill it down, firing off the workflow for each item.

At that point the if trigger portion can be removed from the workflow or change the default value of the column to 1 and hide it. Then new items submitted will process normally.

share|improve this answer
add comment

I've done something similar using a custom timer job to trigger a workflow on each item in a list. The bit of code which does that looks like this:

using (SPSite siteCollection = new SPSite("...Site...")) 
{
    using (SPWeb site = siteCollection.OpenWeb("...SubSite..."))
    {
        SPList taskList = site.GetList("...ListPath...");
        SPWorkflowAssociation workflowAssociation = 
            taskList.WorkflowAssociations.GetAssociationByName(
                "...WorkflowName...", 
                System.Globalization.CultureInfo.CurrentCulture);

        foreach(SPListItem item in taskList.Items)
        {
            try
            {
               siteCollection.WorkflowManager.StartWorkflow(
                   item, 
                   workflowAssociation, 
                   workflowAssociation.AssociationData);
            }
            catch { ... }
        }
    }
} 
share|improve this answer
add comment

I haven't used this tool before, however it may be what you are looking for:

http://spworkflowstarter.codeplex.com/ - Sharepoint Workflow Starter

According to is description, it can do what you are looking for.

share|improve this answer
add comment

Not sure about the tool John mentioned but you need to aware of SharePoint capacity limits when it comes to workflow. I cannot find the official information for SharePoint 2007, but as far as I remember it's the same as for SharePoint 2010. Official documentation states:

15 is the maximum number of workflows allowed to be executing against a content database at the same time, excluding instances that are running in the timer service. When this threshold is reached, new requests to activate workflows will be queued to be run by the workflow timer service later. As non-timer execution is completed, new requests will count against this threshold. This is limit can be configured by using the Set-SPFarmConfig Windows PowerShell cmdlet. For more information, see Set-SPFarmConfig. Note: This limit does not refer to the total number of workflow instances that can be in progress. Instead, it is the number of instances that are being processed. Increasing this limit increases the throughput of starting and completing workflow tasks but also increases load against the content database and system resources.

I have no idea what you are trying to do here, but you need to check this limit before you start your implementation. Maybe a custom timer job, or SharePoint Workflow Starter can workaround this limitation.

share|improve this answer
    
In a nutshell, what I'm doing is I've created a workflow for a list of projects. These projects have due dates and when the due date is passed, certain escalations need to happen. So I want to start the workflow so it can sit in suspense and wait for those due dates to happen (the list is already pre-populated). So they'd be stuck in the timer for some time (most of these dates are months ahead). –  tekiegreg Nov 29 '11 at 19:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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