Sharepoint 2013 Develop a Visual Studio 2012 Workflow

In Visual Studio 2012 you can create Sharepoint 2010 WFs or Sharepoint 2013 WFs.

Sharepoint 2013 WFs are declarative WFs, so they don’t have code associated or a dll to deploy to GAC.

In this sample, I  created a VS 2012 WF in a empty Sharepoint 2013 project, deployed as a sandbox solution.

First step is to create the project:


Select deploy as a sandbox solution:


After your project is created, select Add a New Item and choose Workflow:


At this point you can choose between a List or a Site Workflow. Site Workflows, were introduced in Sharepoint 2010, and they run at the Site level.

In this sample I choose to use a List Workflow:


In the next step I selected the Document list, this is the list, where the Workflow will be available:


In the next step I choose to create a new task and history lists:


The last step, is to select the startup type, for your Workflow, it can be manual, On Item Added and On Item Updated.

After this step you can start creating your Workflow:


In the Toolbox, you can see the activities that you can use in your Workflow, you just need to drag them to your WF design.

If you explorer your solution, you can see that you have a feature to create a history list and a task list to your Workflow.

My Workflow starts writing to history list “WFStarted”.

Next I Create the tasks to get the user name that created the current item.

First you need the “LookupSPListItem” activity to get the ListItem properties.

Next “GetDynamicValueProperties” to get the ListItem AuthorID to a WF Variable:


Next you need the “LookupSPUser” to get the User properties for the AuthorId:


And another “GetDynamicValueProperties” to get the LoginName, to a Workflow Variable.


And finally the task that writes to history list the message “WFSample End Author:” + username


The all  Workflow  is:


After deploy the solution, the Workflow will run in Documents list:


Tags: ,

4 responses to “Sharepoint 2013 Develop a Visual Studio 2012 Workflow”

  1. cyberpine says :

    Excellent – Thank You! I’ve subscribed.

    1. Can a vs2012/WF2013 like this be deployed on SharePoint Online 2013?
    2. Does WF 2013 offer me more options for example, can I change item/file permission on Library Document?
    3. What do I need installed with VS 2012? Do I need SP 2013 installed on the same Dev server? where does WorkFlow Manager 1.0 fit into this if anywhere?

    Here’s what I’m really trying to do on SPO..

    Thanks for any information on this!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: