.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Cannot start sharepoint workflow using "SPWorkflowManager.StartWorkflow" - unknown exception is thro

Posted By:      Posted Date: October 12, 2010    Points: 0   Category :SharePoint


I have been working on a sharepoint project for a month now and it seems nothing just works right off the bat even if I go online and copy from someone's implementation.

I read about starting workflows programmatically from this site and I am currently using the following code to start my workflow.



    SPListItem item = workflowProperties.Item;

                    SPWorkflowManager objWorkflowManager = item.Web.Site.WorkflowManager;

                    SPWorkflowAssociationCollection associatedWorkflows = item.ParentList.WorkflowAssociations;

                    SPWorkflowAssociation workflow = associatedWorkflows.GetAssociationByName(

                        "ConfirmationFlow", System.Globalization.CultureInfo.CurrentCulture);


                    //Find the GUID for the workflow association 

                    string strSerializedParams = Utils.Serialize(r, new XmlSerializer(typeof(MyType)));


View Complete Post

More Related Resource Links

Workflow "Failed on Start (retrying)" when new item created by BizTalk SharePoint Adapter


We've been using the BizTalk SharePoint Adapter to load various different contents into a MOSS 2007 Document Library. The library has a Microsoft Office SharePoint Designer 2007 workflow (sequential workflow created in Designer) which starts automatically when a new item is added to the Document Library. Or, at least, it eventually starts automatically.


For some unknown reason--and this is what we're hoping some of you may have some ideas on--the workflow fails to start on the first try, producing the "Failed to Start (retrying)" message. When the timer job comes back the second time, the workflow starts successfully, but this causes us to loose five minutes of potential work time (not to mention making us look bad to the VPs and CTO because they see the failure message).


In checking the log, I find the following pair of error messages each time the "Failed to Start (retrying)" status occurs:


08/27/2007 13:49:43.24  w3wp.exe (0x0CA0)                        0x1438 Windows SharePoint Services    Workflow Infrastructure        72fs Unexpected RunWorkflow: Microsoft.SharePoint.SPException: <Error><CompilerError Line="1" Column="1" Text="The root activity type is invalid.&q

SharePoint 2010 Long Starting if start workflow programatically


In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

					SPList currentList = web.Lists[new Guid(ListId)];
					SPListItem currentListItem = currentList.GetItemById(ListItem);

					//resolve any lookup parameters
					string workflowId = base.ProcessStringField(WorkflowIdentifier);

					//find workflow association by name
					SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, Thread.CurrentThread.CurrentCulture);

					if (workflowAssoc != null)
						//start the workflow
						SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, workflowAssoc.AssociationData, SPWorkflowRunOptions.Synchronous);

And workflow #2  will hang with Starting status (1-10 minutes), Then the workflow #2 status would be modified  to Completed.

I couldn't find how to start the workflow # 2 immediately and complete immediately without several minutes delay

How to start a workflow programmatically that was created in Sharepoint designer 2010?

Trying to start a workflow from code.  The workflow itself has been created in SPD 2010, which from what I understand, means that there is no assembly until the first time it's ran.  However, when I try to find the association record, that doesnt exist.  Is this becuase the 'code' hasnt been compiled yet?  If so, how can I have sharepoint start the just-in-time compiler for a declarative based workflow, so that can kick it off with in code? tia Rocky SandersRocky Sanders

Cannot Start Workflow - Frozen SharePoint



I started a Publishing portal site (with workflow), and took all the default settings.  After editing the default page (/Pages/Default.aspx), I tried to submit the changes for approval.


This starts the "Parallel Approval" workflow.  When I hit "OK" to start the workflow a status box pops up with "Sending Data to the Server..." and freezes.  Out of curiosity I let it run while I went to lunch and it was still stuck when I got back.


I've tried creating another publishing site, a new web application, a new publishing Site Collection with a publishing subsite, creating a new workflow for approval; anything else I could possibly think of.  However, it still freezes.


It will also freeze if I try to add a name to CC the task to.  I know this isn't an Active Directory issue, since at all other places in the site (as with authenication) it has no trouble using AD.


Does anyone know what the issue is?




SharePoint Workflow : Failed to Start when a document is added to library from server-side object mo


When I add a document using my server-side object model code, I get an exception "The type or namespace name 'Office' does not exist in the namespace 'Microsoft'" in the server logs and in the library I can see the Workflow status as "Failed to Start".





Interestingly, when I add a document to the same library from sharepoint site portal, it works just fine, the workflow kicks off with the state : in-progress.

Also, I modified the task form for the Approval workflow template from SharePoint Designer using infopath.(Not sure if that be a problem as adding from portal works fine.)

What am I missing out here??

 Details of the exception:

09/29/2010 18:11:19.15  w3wp.exe (0x2508)                        0x2710 SharePoint Foundation          Workflow Infrastructure        98d8 Unexpected Microsoft.SharePoint.SPException: <Error><CompilerError Line="0" Column="20" Text="The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (a

Start a SharePoint 2010 WorkFlow using JavaScript



I need to start a SharePoint WorkFlow using JavaScript, the JavaScript would be in bespoke Asp.Net page. Any ideas ?



SharePoint 2010 Workflow "Failed on Start"


I have a list workflow for SP 2010 that was previoulsy working this morning and decided to "Fail on Start" at some point.  I have done nothing to the list or workflow settings, I have just been working in SP Designer 2010 creating the WF.  I have searched high and low and have found all of the same answers that get me no where.  The suggestions include comparing the Workflow.xml and/or feature.xml to the name .dll in the GAC. 

I have no workflow.xml or feature .xml files other than what I find in my Visual Studio folders from workflows past.  This time I am not using Visual Studio.  I am using SPD 2010, does it keep those files?  Secondly, I find only one of my workflowname.dll's in the GAC, also from an old VS workflow.  My current workflow.xml, feature.xml and currentworkflow.dll files do not exist on my workstation or server.  WHAT am I missing here??? :-(


North to the Future

SharePoint (MOSS2007) + Office2003 + IE 6 => crash: "unknown software exception (0xc06d007f)"


We use MOSS2007 and all users use Office2003. Some users cannot enter the SharePoint pages as IE6 crashes when they try to (generally enter not just commit changes or whatsoever).

Although it is technically possible to perform changes on the OWSSUPP.DLL the users are far away and not very skilled. This would be the last measure to take if nothing else works.

There were related topics already discussed Related topics already discussed as having been patched but here everything gets a bit difficult. I cannot make the users perform updates that have not been specified by an internal institution. It is thus not enough for us that this issue has been fixed in updates. I have to know which patches or updates are necessary so that I can request them to be installed.

I would be really great if someone would share further details on the necessary updates.

Thank you very much.

With kind regards,


Need to start a workflow from an incoming mail on Sharepoint SP1






Im using SPD to create the workflow becouse I cant use VS2008 on Sharepoint 64.

I need to get a workflow to start when a mail coming to a document library but it must start automatically.

Is there some other way to make this happen do anyone know how its possible?

Sharepoint Foundation 2010 Workflow Start Options


I have Sharepoint Foundation 2010 installed and Sharepoint Designer. When I create a Site workflow there are 2 Start Options grayed out, 1) Start this workflow to approve publishing a major version of an item. 2) Start this workflow when an item is changed.

Is there an onther setting to prior to creating the workflow to turn these option on or are these 2 options not available in Sharepoint Foundation 2010?


Free Series of SharePoint Workflow How-to Videos

This is the series of "How to" Document Workflow with SharePoint using Visual Studio 2008 (using the .NET Framework 3.0 for backward compatibility to Visual Studio 2005). I have created video's that show the most common requests that I have seen around MOSS/SharePoint 2007 workflow & document workflow.

SharePoint 2007 Workflows - Things to Consider Before You Start

SharePoint 2007 (MOSS) utilizes the Workflow Foundation (WF) to enable workflows on lists and content types. But before you start doing cartwheels there are few things you should know before you get started. The experiences I'll be discussing are not from book smarts but from building real MOSS solutions that are in production today.

Workflow Essentials: Collaborative Workflow Improvements in SharePoint 2010


In this article, the author covers the new features in SharePoint 2010 geared for workflow developers and then walks the reader through a couple of new user scenarios.

Paul Andrew

MSDN Magazine November 2009

Sharepoint Wiki Custom Workflow


Has anyone done custom workflows for a sharepoint Wiki page? 

The workflow I'm trying to do is, whenever a new wiki page is created I want a new Discussion page  to be created for that wiki page?

Any Help?

Setting permissions of a specific SharePoint workflow


We have a very simple workflow whereby an document placed in a public library (INBOX) is moved it to a private library (VERIFY) and then deleted. The workflow works correctly when someone who has access to the VERIFY library drops a record into the INBOX library.  However it does not work when the user does not have access to the VERIFY library.

I was told that I need to "set the AD group associated with a specific SharePoint workflow" but cannot find any reference to this in SPD.



Terminating a SharePoint Workflow Programatically



I have a custome workflow coded in VS 2005 and deployed in to GAC and associated to a List in the SharePoint Portel through MS SharePoint Designer.


When an Exception happened in the code, the worklow instance' Status is shown as "Error Occured" and get suspended. since this workflow instance is "hung up" at this list item another instance of the workflow can't run. To run another instance you have to go into the SP Portal --> List and click on the "Error Occured" under the workflow of the item and then you have to terminate the workflow by clicking on the "Terminate this workflow now" link.


I just need to do this function ("Terminating the workflow") in the code in my Catch block where i handle the exception of the workflow activity.


could some one please tell me how to do this? or even point me in the right direction?


i've so far tried varity of:





ActivityBind activityBind = new

Attach Workflow to Task List, don't get option to manually start workflow via dropdown on task item



I am running WSS 3.0 with other workflows which are functioning correctly.  I created a new workflow in Visual Studio 2008 and was able to successfully run it in my dev environment.  I attached the workflow to a task list in my dev environment and was able to manually start the workflow by using the drop down workflow option and using the menus to manually start it.  I installed this workflow in our production environment and attached it to the task list (which had a SPD workflow attached to it which stopped working about a month ago).  I made sure that the option to manually start the workflow was checked.  When I tried to manually start the workflow, (hover mouse over title, drop down) there isn’t a workflow option.  The workflow also will not start automatically when a task is changed.


I attached this same workflow to a different task list in production and get the option to start it.


I have tried creating a small workflow in SPD 2007 and attaching it to the task list.  It shows that it is attached, when I look at the workflows that are attached to the task list, but I still don’t get the option to manually start it.


I have checked my security and I have fu

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend