StartSiteWorkflow

Starts an instance of the specified site workflow, optionally providing workflow association data.

Syntax

public Guid StartSiteWorkflow(
	string workflowName,
	string associationData
)

Parameters

workflowName
Type: System.String

Optional. The name of the site workflow.

associationData
Type: System.String

Optional. The association data to use for the site workflow. If association data is not specified, default values specified for workflow variables in the site workflow are used.

Type: Guid

The identifier of the resulting workflow instance.

Remarks

The method runs within the context of the current SharePoint site, determined by the endpoint URL used to invoke the operation. For more information about invoking SOAP methods for Nintex Workflow 2013, see Service operations.

The method attempts to retrieve an existing workflow association between the current site and the site workflow specified in workflowName. If the context of the current site cannot be determined, or if a workflow association between the site and the site workflow does not exist, an error occurs; otherwise, the method attempts to start the site workflow immediately. If the site workflow cannot be started immediately, it is deferred and the method returns the identifier of the resulting unstarted workflow instance; otherwise, the method returns the identifier of the resulting started workflow instance.

Setting Association Data

The associationData element contains an XML-encoded string, representing an XML fragment. The XML fragment is a single element, named Data, that can contain values for workflow variables defined in the site workflow. For more information about using association data, see Using association data for starting workflows.

Note: You cannot include the Data element within the associationData element without first converting it to an XML-encoded string; otherwise, an error occurs. For an example, see StartWorkflowOnListItem.

Example

The following example demonstrates how to use this operation to start a site workflow, without providing association data.

Request

The following SOAP request attempts to start the TestSiteWorkflow site workflow, without providing association data.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:nin="http://nintex.com">
   <soap:Header/>
   <soap:Body>
      <nin:StartSiteWorkflow>
         <nin:workflowName>TestSiteWorkflow</nin:workflowName>
         <nin:associationData />
      </nin:StartSiteWorkflow>
   </soap:Body>
</soap:Envelope>

Response

The following SOAP response returns the identifier of the started workflow instance.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" 
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <StartSiteWorkflowResponse xmlns="http://nintex.com">
         <StartSiteWorkflowResult>f50330b0-9b2d-40a5-bf16-c241326aa2fe</StartSiteWorkflowResult>
      </StartSiteWorkflowResponse>
   </soap:Body>
</soap:Envelope>

See Also

Concepts

Workflows

Operations

Starting workflows

Managing workflow execution

Reference

StartWorkflow

TerminateWorkflow

TerminateWorkflowByName

Web Service Reference