SharePoint 2013 – Exception calling “StartWorkflow” with “4” argument(s): “”

Today I tried to start a workflow using PowerShell and I got this annoying error:

Exception calling “StartWorkflow” with “4” argument(s): “”

At C:\Users\spsetup\Downloads\StartDocumentLocksWF.ps1:38 char:9

+ $wf = $wfm.Startworkflow($item,$association, $data,$true)

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException

+ FullyQualifiedErrorId : SPException


I knew that I was doing the right thing  as this worked for another workflow:

$ver = $host | select version

if($Ver.version.major -gt 1)


   $Host.Runspace.ThreadOptions = “ReuseThread”


if(!(Get-PSSnapin Microsoft.SharePoint.PowerShell -ea 0))


   Write-Progress -Activity “Loading Modules” -Status “Loading Microsoft.SharePoint.PowerShell”

   Add-PSSnapin Microsoft.SharePoint.PowerShell


# Settings

$siteUrl = “https:/ /”

$web = Get-SPWeb $siteUrl

$list = $web.Lists[“Docs”];

#– Getting a Workflow manager object to work with.

$wfm = $web.Site.WorkFlowManager

#– Getting the subscriptions

$association = $list.WorkFlowAssociations |Where { $_.Name -eq “Handle Document Locks”}

$data = $association.AssociationData


$wc.UseDefaultCredentials = $true

foreach ($item in $list.Items)


   Write-Host $item[“Title”] $item.ContentType.Name

   if ($item.ContentType.Name -eq “My Document”)


        $wf = $wfm.Startworkflow($item,$association, $data,$true)

        Start-Sleep -Seconds 10





I am not doing anything complicated, just starting a workflow. The workflow that I was starting however didn’t have manual start enabled and therefoe I wasn’t able to start it with PowerShell either.

Enabling the manual start and then republishing the workflow and all worked as expected.

 Note:  the same error message will also appear when the workflow is already started.




One thought on “SharePoint 2013 – Exception calling “StartWorkflow” with “4” argument(s): “”

  1. Thanks for the comments about requiring manual start & that the workflow cannot be currently running. Was testing this step as part of a script to stop & restart the workflow, and overlooked the fact that I hadn’t stopped the running instance for my test! Good catch, and useful info I didn’t find elsewhere.


Please leave a comment or feedback

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.