There may be a requirement to pass certain workflow variables between workflows when you split a larger process into small workflows.

To do this the target workflow can be configured with start data variables. These start data variables can then automatically be populated when the workflow is started through the nintex web service.

Create a new workflow as normal and select Workflow Settings then variables and then create a new variable.

n1

In this example 2 workflow variables were created as start data.

EmpID –             Single line of text LeaveREQ –             Number

To test starting a workflow with these variables automatically set when the workflow starts using web service method. In this example the StartWorkflowOnListItem method will be used.

The first step is to use a build dynamic string action to create the association Data XML that will be required.

The format for the association data parameter is as follows:

<Data>
<StartDataItem1>value1</StartDataItem1>
<StartDataItem2>value2</StartDataItem2>
<StartDataItem3>value3</StartDataItem3>
</Data>

Based on the workflow we are attempting to start there are 2 start data items EmpID and LeaveREQ.

The association data will be as follows:

<Data>
<EmpID>x067900</EmpID>
<LeaveREQ>4</LeaveREQ>
</Data>

This will set the variable EmpID to x067900 and LeaveREQ to 4.

The best method to use when creating a start data variable is to build the value first using a build dynamic string action

n2

To use this start data within a call web service action the configuration is as follows

n3

Ensure Encode inserted tokens is selected.