# Web Services API: WorkflowContext specifications and usage

**URL:** <https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315>\
**Category:** Web API\
**Created:** [December 19, 2013, 4:54am UTC](https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315 "2013-12-19T04:54:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wfg-admin](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/wfg-admin/32/714_2.png) [@wfg-admin](https://discuss.workflowgen.com/u/wfg-admin)\
**Post date:** [December 19, 2013, 4:54am UTC](https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315/1 "2013-12-19T04:54:57Z")

</div>

The WorkflowGen Web Services API uses WorkflowContext data structure in important web methods such as:

- `CompleteActivityInstance`

- `GetActivityInstanceContext`

- `StartProcess`

WorkflowContext is an XML data structure used to exchange parameters with WorkflowGen. The XML data structure is based on the `ADO.NET` Dataset object (serialized in XML) or the ADO Recordset (serialized in XML). This means that the structure is similar to database tables and records.

This article will use the `ADO.NET` Dataset format for the WorkflowContext. Here’s an example of a WorkflowContext:

```auto
<NewDataSet>
    <parameter>
        <name>COMPANY</name>
        <dataType>TEXT</dataType>
        <direction>OUT</direction>
        <textValue>My company</textValue>
    </parameter>
    <parameter>
        <name>AMOUNT</name>
        <dataType>NUMERIC</dataType>
        <direction>OUT</direction>
        <numericValue>1000</numericValue>
    </parameter>
    <parameter>
        <name>APPROVAL_DATE</name>
        <dataType>DATETIME</dataType>
        <direction>OUT</direction>
        <dateTimeValue>2013-11-18T16:11:51-05:00</dateTimeValue>
    </parameter>
    <parameter>
        <name>ATTACHMENT</name>
        <dataType>FILE</dataType>
        <direction>OUT</direction>
        <fileName>report.xls</fileName>
        <fileDescription>My report</fileDescription>
        <fileSize>202345</fileSize>
        <fileContentType>application/vnd.ms-excel</fileContentType>
        <fileDateLastModified>2013-10-15T16:11:51-05:00</fileDateLastModified>
        <fileOriginalPath>C:\myfolder\report.xls</fileOriginalPath>
        <filePath>C:\myfolder\report.xls</filePath>
    </parameter>
</NewDataSet>

```

**`<NewDataSet>` node**

This is a Dataset object that contains a set of parameters (parameter nodes) and one session information (session node).

**`<Parameter>` node**

The `Parameter` node contains information about the parameter to exchange with WorkflowGen web method:

- `<name>` node: The name of the parameter defined in the Workflow Action.

- `<dataType>` node: This node can have one of the following values: `TEXT`, `NUMERIC`, `DATETIME`, `FILE`.

- `<direction>` node: This node can have one of the following values: `IN`, `OUT`, or `INOUT`.

- `<textValue>` node: The text value of the parameter.

- `<numericValue>` node: The numeric value of the parameter.

- `<dateTimeValue>` node: The datetime value of the parameter. The date format is `xsd:dateTime`. Note that Datetime values are stored in GMT.

- `<fileName>` node: The file name.

- `<fileDescription>` node: The file description.

- `<fileSize>` node: The file size in bytes.

- `<fileDateLastModified>` node: The date of the last modification of the file. The date format is `xsd:dateTime`.

- `<fileContentType>` node: The file MIME type.

- `<fileOriginalPath>` node: The original path of the file (for information only).

- `<filePath>` node: The file path. WorkflowGen uses this path to retrieve the file.

#### WorkflowContext creation with WorkflowGen.My

To simplify WorkflowContext creation and modification you can use WorkflowGen.My and its `WorkflowGen.My.Data.ContextParameters` class. Here’s an example in C#:

```auto
WorkflowGen.My.Data.ContextParameters myWorkflowContextParameters = new WorkflowGen.My.Data.ContextParameters();

WorkflowGen.My.Data.ContextParameter contextParamApproval = new WorkflowGen.My.Data.ContextParameter();

contextParamApproval.Name = "DECISION";

contextParamApproval.Direction = WorkflowGen.My.Data.ContextParameter.Directions.Out;

contextParamApproval.Type = typeof(string);

contextParamApproval.Value = "YES";

myWorkflowContextParameters.Add(contextParamApproval);

myWorkflowContextParameters.Update();

string workflowContext = myWorkflowContextParameters.GetXml();

```

---

<div class="post-metadata">

**Author:** ![jason.smith](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jason.smith](https://discuss.workflowgen.com/u/jason.smith)\
**Post date:** [March 14, 2019, 8:48pm UTC](https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315/2 "2019-03-14T20:48:20Z")

</div>

Is there a limitation to how many parameters can be sent? Maybe a limit to the length of the url?

---

<div class="post-metadata">

**Author:** ![eddy.daouk](https://yyz2.discourse-cdn.com/flex030/user_avatar/discuss.workflowgen.com/eddy.daouk/32/672_2.png) [@eddy.daouk](https://discuss.workflowgen.com/u/eddy.daouk)\
**Post date:** [March 20, 2019, 3:00pm UTC](https://discuss.workflowgen.com/t/web-services-api-workflowcontext-specifications-and-usage/315/3 "2019-03-20T15:00:34Z")

</div>

Hi @jason.smith,

This depends on the browser’s limitation. If you think you’ve reach a limit, it’s better to use an **HTTP POST** instead of an HTTP GET request.

Regards,  
Eddy.
