Workflow deployment process (SharePoint Server 2010)
Applies to: SharePoint Server 2010, SharePoint Foundation 2010
After you prepare a workflow for use in Microsoft SharePoint Server 2010, deployment of the workflow varies depending on whether you use a predefined workflow, a Microsoft Office SharePoint Designer workflow, or a Microsoft Visual Studio custom workflow.
This article contains information and procedures about how to deploy workflows in SharePoint Server 2010.
In this article:
Overview
SharePoint Server 2010 provides a set of predefined workflows that can be used to guide and track common tasks such as document review or approval.
You can also use Office SharePoint Designer to define your own workflows, or you can use Visual Studio to create code-based custom workflows. Workflows are built on Windows Workflow Foundation. For more information, see Windows Workflow Foundation (https://go.microsoft.com/fwlink/p/?LinkId=166185). The workflows run in SharePoint sites and are integrated with and available across the Microsoft Office system, as follows:
SharePoint Server 2010: Used to host workflows. After a workflow is deployed to the host, you can activate, configure, start, participate in, and track the workflow.
SharePoint Designer 2010: Used to create user-defined workflows.
Visual Studio: Used by developers to create workflows.
Microsoft Visio 2010: Used together with SharePoint Designer 2010 to visualize and create user-defined workflows.
Microsoft Word, Microsoft PowerPoint, Microsoft Excel, and InfoPath Forms Services: Used to start and participate in workflows.
Microsoft Outlook: Used to receive workflow notifications and track tasks.
Important
The last two items in this list that relate to integration with the Microsoft Office 2010 suites and InfoPath Forms Services are available only in SharePoint Server 2010. They are not available in SharePoint Foundation 2010.
Note
To use Visio 2010 for workflow visualization, you must be running the Enterprise version of SharePoint Server 2010 and Visio 2010 Premium.
Before you begin
Before you perform the deployment procedures in this article, confirm that the server is running the Standard or Enterprise version of SharePoint Server 2010.
Deploying workflows
A number of predefined workflows have already been installed as SharePoint Features in SharePoint Server 2010.
Workflows in a SharePoint Web site are stored as workflow templates. As an alternative to using the predefined workflows, you can create SharePoint workflow templates in Office SharePoint Designer and Visual Studio, and then deploy them to a SharePoint Server 2010 Web site. Use SharePoint administration tools as needed to add the template to libraries or lists on a SharePoint Server 2010 Web site.
To deploy a predefined workflow, you activate it for the site, associate it with a list, library, content type, or site, and then start the workflow.
To deploy workflows in SharePoint Server 2010, use the appropriate procedure from the following:
Deploy predefined workflows
Deploy SharePoint Designer workflows
Deploy Visual Studio workflows
Deploy predefined workflows
Activate the workflow
As described earlier in this article, before you can use a predefined workflow, it must be active in the site or site collection. Only active workflows can be associated with the lists and libraries on the site or site collection.
Many of the predefined workflows are active by default when a site or site collection is created. Because workflows can be deactivated, you can check the site or site collection to determine whether the predefined workflow that you want to use is active. Use the following procedure to determine whether the predefined workflow that you want to use is active, and then activate the predefined workflow as necessary.
Note
In SharePoint Foundation 2010 there is only one predefined workflow, the Three-state workflow, and it is active by default when a site or site collection is created in SharePoint Foundation 2010.
To activate a workflow that is deployed as a feature, such as the predefined workflows, see Activate or deactivate a workflow (SharePoint Server 2010).
Add the workflow association to a list, library, content type, or site
When you add a workflow, you associate the workflow with a list, library, content type, or site. You configure the workflow by specifying parameters such as the workflow name, start options, participants, and completion options.
To add a workflow association, see Add a workflow association (SharePoint Server 2010).
Start the workflow
After you activate a workflow and add it to a list, library, content type, or site, an authenticated user can run the workflow on an item in the list, on a document in the library, or on a site in the case of a site workflow. When you add the workflow, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, a user can modify the default settings, such as specifying workflow participants and specifying a due date. The workflow runs on items in the list or documents in the library with which the workflow is associated.
The procedure for starting a workflow depends on whether it was configured to start manually or automatically and whether you start it from SharePoint Foundation 2010 or SharePoint Server 2010, or from the Office system.
Note
To enable users to start workflows in the Office 2010 suites, you must be running SharePoint Server 2010. SharePoint Foundation 2010 does not enable users to start workflows in the Office 2010 suites.
For more information, see Start a workflow instance (SharePoint Server 2010).
Deploy SharePoint Designer workflows
When user-defined workflows are enabled, users can deploy Office SharePoint Designer workflows on their sites.
Enable user-defined workflows
To allow users to create and run SharePoint Designer 2010 workflows, you must ensure that user-defined workflows are enabled for the site collection. By default, this setting is enabled. When this setting is enabled, users can define workflows in a declarative workflow editor such as the SharePoint Designer 2010 workflow editor. A declarative workflow is a workflow that is built from conditions and actions that are assembled into rules and steps, and that sets the parameters for the workflow without writing code. Unlike code-centric workflows such as those that are created by using Visual Studio, declarative workflows are not deployed to SharePoint Server 2010 as compiled code. Instead they are compiled at runtime.
Because the capability to use declarative workflows on the Web application can be turned off, you can check the Web application to determine whether declarative workflows are active.
For information, see Enable or disable declarative workflows (SharePoint Server 2010).
Create a SharePoint Designer workflow
By using the Workflow Designer wizard in SharePoint Designer 2010, you can create workflows that add application logic to the site or site collection without writing custom code. The Workflow Designer incorporates the tasks of creating the workflow, activating the workflow, and adding it to the list, library, or site. You do not have to perform any manual configuration tasks outside the designer to deploy the workflow. However, if you publish a workflow template to a SharePoint site collection, you can download that template as a WSP file and then deploy it to other site collections. For more information, see Deploy a workflow as a WSP file (SharePoint Server 2010).
Start the workflow
Because SharePoint Designer 2010 can automatically activate the workflow and add it to a list, library, or site, an authenticated user can then run the workflow on an item in the list, on a document in the library, or on a site in the case of a site workflow. When you create the workflow in SharePoint Designer 2010, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, a user can modify the default settings, such as specifying workflow participants and specifying a due date, as allowed by the workflow template. When started, the workflow runs on items in the list, on documents in the library, or on the site with which the workflow is associated.
The procedure for starting a workflow depends on whether it was configured to start manually or automatically and whether you start it from SharePoint Server 2010, or from the Office system.
Note
To enable users to start workflows in the Microsoft Office 2010 suites, you must be running SharePoint Server 2010. SharePoint Foundation 2010 does not enable users to start workflows in the Office 2010 suites.
For more information, see Start a workflow instance (SharePoint Server 2010).
Deploy Visual Studio workflows
After a Visual Studio custom workflow is created and installed, the processing to deploy it resembles that of a predefined workflow.
Create a custom workflow
When a custom workflow is created by using Visual Studio, it is packaged as a SharePoint Feature. Feature packaging is a way of encapsulating SharePoint solutions and functionality for ease of deployment. After the development team has created a workflow and packaged it as a Feature, deploy the workflow using the Install-SPFeature Windows PowerShell command as described in the following section.
Install the custom workflow
You install Features in the \Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features directory. Each Feature is in its own subdirectory. At the root of this folder, a Feature.xml file defines the contents of the Feature. Use the Windows PowerShell Install-SPFeature cmdlet to install the Feature. For details, see Install-SPFeature.
Important
To run Windows PowerShell, you must be a member of the Administrators group on the local computer. Also, Windows PowerShell must be enabled as a feature on the server on which you are installing a workflow.
Activate the workflow
Before you can use a Visual Studio workflow that was deployed as a feature, you must activate it for the site collection. Only active workflows can be associated with the lists, libraries, content types, and sites.
To activate a workflow that is deployed as a feature, see Activate or deactivate a workflow (SharePoint Server 2010).
Add the workflow to a list, library, content type, or site
When you add a workflow, you associate the workflow with a list, library, content type, or site, and you configure the workflow by specifying parameters such as the workflow name, start options, participants, and completion options.
To add a workflow association, see Add a workflow association (SharePoint Server 2010).
Start the workflow
After you activate a workflow and add it to a list, library, content type, or site, an authenticated user can run the workflow on an item in the list or a document in the library or in the case of a site workflow, on a site. When you add the workflow, you specify whether you want the workflow to run automatically or manually. If the workflow is configured to start automatically, the default settings are always used when the workflow begins. If the workflow is configured to start manually, the user can modify the default settings, such as specifying workflow participants and specifying a due date. The workflow runs on items in the list or documents in the library with which the workflow is associated.
The procedure for starting a workflow depends on whether it was configured to start manually or automatically and whether you start it from SharePoint Foundation 2010 or SharePoint Server 2010, or from the Office system.
Note
To enable users to start workflows in the Office 2010 suites, you must be running SharePoint Server 2010. SharePoint Foundation 2010 does not enable users to start workflows in the Office 2010 suites.
For more information about starting a workflow, see Start a workflow instance (SharePoint Server 2010).
Verification
After you deploy a workflow, we recommend that you test the workflow to ensure that it is functioning correctly, sending e-mail notifications to the correct workflow participants at the correct stages in the workflow, and delivering the expected results.
See Also
Other Resources
Resource Center: Installation and Deployment for SharePoint Server 2010
Resource Center: Workflows in SharePoint Server 2010