Click here to Skip to main content
15,395,065 members
Articles / Web Development / ASP.NET
Posted 15 May 2008


42 bookmarked

SharePoint Workflow Wizard in Visual Studio 2008

Rate me:
Please Sign up or sign in to vote.
3.38/5 (10 votes)
15 May 2008CPOL3 min read
SharePoint Workflows Wizard in Visual Studio 2008


Visual Studio tools for office 2008 provides variety of workflow templates. Ofcourse, these workflow templates are based on Windows Workflow foundation (WF) . Continuing the efforts of integrating the other technologies usage and making the Visual Studio as a single UI IDE for developing various components of different technology, Microsoft have came up with few workflow templates specific for SharePoint in Visual Studio tools for office. This article will give you sneak preview about the sharepoint workflows and also provide details on why should we use the sharepoint workflow templates of Visual studio 2008. Visual Studio 2008 provides lot of workflow templates. If you see the screen , two of those belong to SharePoint.

1. SharePoint 2007 Sequential workflow
2. SharePoint 2007 State Machine workflow

Brief Overview

Sequential workflow represents a workflow as a sequence of steps that must be executed in order until the last activity is completed. A state machine workflow represents a set of states,transitions, and actions. One state is denoted as the start state, and then, based on an event, a transition can be made to another state. On the right side is a typical example of a Sequential workflow. When you select any of these workflow templates, it executes the workflow wizard that allows debugging on the workflows on SharePoint that requires special permissions. For e.g. this wizard takes care of deploying workflow customization on Global Assembly Cache (GAC).

2.JPG<path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><lock aspectratio="t" v:ext="edit"><shape id="Picture_x0020_1" style="VISIBILITY: visible; WIDTH: 209.25pt; HEIGHT: 185.25pt" alt="Bb386211_SP_Sequential(en-us,VS_90).png" type="#_x0000_t75" o:spid="_x0000_i1025"><imagedata o:title="Bb386211_SP_Sequential(en-us,VS_90)" src="file:///C:\DOCUME~1\nishithp\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png">

Step 1. Select the workflow and the site for debugging

As soon as you select any of the workflow templates, (for this article, I am assuming that you selected the SharePoint 2007 Sequential Workflow), it presents a simple Wizard during project creation to capture settings in an easy-to-use Wizard. In the first step, it asks you to give the workflow a name and also choose a valid SharePoint site where the workflow will be deployed and debugged. One thing would be a restriction on this site selection is that this site should be a local site and cannot be a remote SharePoint site. I hope this issues gets resolved in upcoming SP1 version of VS 2008 . Click on "Next" to move to next step.

3.JPG<path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"><lock aspectratio="t" v:ext="edit"><shape id="Picture_x0020_10" style="VISIBILITY: visible; WIDTH: 229.5pt; HEIGHT: 183pt" type="#_x0000_t75" o:spid="_x0000_i1028"><imagedata src="file:///C:\DOCUME~1\nishithp\LOCALS~1\Temp\msohtmlclip1\01\clip_image001.png">

Step 2 : Choosing the library or list

Since you have selected the SharePoint site on the first step, this time you need to associate the workflow template with a document library or list. Before the VSTO 2008, this work has to be outside by going in the IDE of SharePoint. In this , you choose the document library or the lists. One thing to be aware is that, this wizard does not allow you to create new lists or library. This work has to be still done either manually by going to SharePoint or by using SharePoint object Model. Click on "Next" to move to next step.

4.JPG<shape id="Picture_x0020_13" style="VISIBILITY: visible; WIDTH: 228.75pt; HEIGHT: 182.25pt" type="#_x0000_t75" o:spid="_x0000_i1027"><imagedata src="file:///C:\DOCUME~1\nishithp\LOCALS~1\Temp\msohtmlclip1\01\clip_image003.png">

Step3. : Invoking a workflow

On the last step, wizard lets you configure how an instance of your workflow can be started. There are three ways as shown on the screen

1. Manually by users

2. When an item is created

3. When an item is changed

The first two are selected by default for the easy. After setting these simple configurations in place, the wizard completes, and VSTO creates the new project.

5.JPG<shape id="Picture_x0020_16" style="VISIBILITY: visible; WIDTH: 229.5pt; HEIGHT: 182.25pt" type="#_x0000_t75" o:spid="_x0000_i1026"><imagedata src="file:///C:\DOCUME~1\nishithp\LOCALS~1\Temp\msohtmlclip1\01\clip_image005.png">

Project created : Lets play now

After setting this, a project gets created and by default , few files like features.xml, workflow.xml etc gets created. Now you if you are an expert on workflow foundation, This is your time to do something with the workflow based on your business requirement. Once done, deployment is also as easy as pressing F5. Once deployment, workflow can be debugged by well within the Visual Studio IDE

6.JPG<shape id="Picture_x0020_25" style="VISIBILITY: visible; WIDTH: 228pt; HEIGHT: 165.75pt" type="#_x0000_t75" o:spid="_x0000_i1025"><imagedata src="file:///C:\DOCUME~1\nishithp\LOCALS~1\Temp\msohtmlclip1\01\clip_image007.png">


Earlier debugging the workflow developed in WF and deployed in SharePoint requires a lot of manual steps to be done. These SharePoint workflow templates have brought a sigh of relief for all those developers. This simple wizard has really avoided lot of manual process. I am sure there are much more you will find in Visual studio 2008.

Happy Coding


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Nishith Pathak
Web Developer
India India
Nishith Pathak is an avid reader,Prolific writer, Speaker for Microsoft India,Published Author of APress and a Microsoft Purist.He is MVP, MCPD, MCTS MCSD.Net,MCAD.Net(EA),MCSD. His proficiency lies in exploring Microsoft technology and to share them with other peers. He is a contributing author and an avid technical reviewer for multiple electronic and print publications. He has recently co-authored a book on WCF called Pro WCF: Microsoft Practical SOA Implementation for APress Inc, USA. Over the years, he has also been involved in providing consultancy and training services to corporations. He has been awarded with Microsoft Most Valuable Professional (MVP).Working since beta version of .Net makes his competecy in .Net. He can be contacted at or at his blog Currently he is focused on key areas of the Microsoft platform, specifically Distributed Computing, service orientation and exploring VISTA and help companies architecting solutions based on Service Oriented Architecture.

Comments and Discussions

GeneralMy vote of 1 Pin
avikerchithi5-Jul-11 10:29
Memberavikerchithi5-Jul-11 10:29 
GeneralMy vote of 1 Pin
mbadi25-Jun-10 20:54
Membermbadi25-Jun-10 20:54 
QuestionHow to access remote site Pin
krishna36917-May-10 12:43
Memberkrishna36917-May-10 12:43 
General64-bit problem with Sharepoint Sequential Workflow Template [modified] Pin
Jakob Flygare19-Jan-10 10:46
MemberJakob Flygare19-Jan-10 10:46 
The Sharepoint Sequential Workflow Template (as well as the State Machine) does not work on a 64-bit machine but only on a 32-bit (see this article)

According to Microsoft: "The plan for Visual Studio 2010 is to still not support SharePoint 2007 Workflow projects on a 64bit workstation". This is disappointing. In 2008 the answer was: "In any case, we really wanted to support 64-bit in the VS 2008 release, but the effort required more resources than we had. Admittedly, the exception is not terribly graceful, and we have targeted to rectify this in a future release." (Source)

Is there a workaround in order to use the Sharepoint workflow templates on a 64-bit machine?

modified on Tuesday, January 19, 2010 4:55 PM

Generalhelp!!!!!!!!!!!!!! Pin
siddhesh15930-Jul-09 21:54
Membersiddhesh15930-Jul-09 21:54 
GeneralI'm having a problem in deploying the above sample in the second time Pin
sabithadivakaran31-May-09 22:52
Membersabithadivakaran31-May-09 22:52 
GeneralRe: I'm having a problem in deploying the above sample in the second time Pin
Chintan.Desai5-Apr-13 0:06
MemberChintan.Desai5-Apr-13 0:06 
QuestionCreate visual studio 2008 workflow to a sharepoint sub sites Pin
Robi-Robo18-May-09 20:28
MemberRobi-Robo18-May-09 20:28 
Questionwf task e-mail Pin
don evangelista28-Jan-09 16:51
Memberdon evangelista28-Jan-09 16:51 
Questionworkflow task e-mail Pin
don evangelista28-Jan-09 16:50
Memberdon evangelista28-Jan-09 16:50 
AnswerRe: workflow task e-mail Pin
Ozgur KOC19-Mar-09 22:49
MemberOzgur KOC19-Mar-09 22:49 
GeneralSharepoint workflow with VS2008 - Configurable Approver Pin
Member 344944230-Oct-08 11:27
MemberMember 344944230-Oct-08 11:27 
GeneralRe: Sharepoint workflow with VS2008 - Configurable Approver Pin
fred_11-Mar-10 5:39
Memberfred_11-Mar-10 5:39 
GeneralRe: Sharepoint workflow with VS2008 - Configurable Approver Pin
Member 84421737-Dec-11 22:56
MemberMember 84421737-Dec-11 22:56 
QuestionWhat about production deployment? Pin
McSafe19-Aug-08 23:02
MemberMcSafe19-Aug-08 23:02 
AnswerRe: What about production deployment? Pin
Nishith Pathak20-Aug-08 20:06
MemberNishith Pathak20-Aug-08 20:06 
QuestionDifficulty moving workflow to sharepoint site Pin
Member 456347529-Jul-08 7:33
MemberMember 456347529-Jul-08 7:33 
AnswerRe: Difficulty moving workflow to sharepoint site Pin
Nishith Pathak20-Aug-08 20:04
MemberNishith Pathak20-Aug-08 20:04 
QuestionWF in VS 2008 on Client machine Pin
nmq3-Jul-08 20:03
Membernmq3-Jul-08 20:03 
AnswerRe: WF in VS 2008 on Client machine Pin
nmq7-Jul-08 23:16
Membernmq7-Jul-08 23:16 
GeneralRe: WF in VS 2008 on Client machine Pin
HansErik20-Aug-08 4:44
MemberHansErik20-Aug-08 4:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.