I'm trying to start a workflow programmatically at the end of another workflow. Everything works fine, except that the new workflow is not started immediately, but queued for execution. This is how I start the workflow:
SPListItem currentItem = workflowProperties.Item; SPWorkflowAssociation wfAssociation = currentItem.ParentList.WorkflowAssociations.GetAssociationByBaseID( new Guid("next-workflow-guid")); SPWorkflow nextWorkflow = currentItem.Web.Site.WorkflowManager.StartWorkflow( currentItem, wfAssociation, wfAssociation.AssociationData, true);
I read about the timer service, that is responsible for the workflow execution, and checked the corresponding property:
PS C:\Windows\system32> STSADM -o getproperty -pn job-immediate-alerts -url "http://my-sp-site/" <Property Exist="Yes" Value="every 5 minutes between 0 and 59" />
Is there any way to work around the timer and say something like "Timer, please go and check now if there is anything on your queue" ?