Genpact Cora Knowledge Center

Support

POST /ProcessesService.svc/StartWorkflow

Starts the workflow that you specify in the request. You can assign values to the instance parameters by using the Variable object.

Method

POST

URL

https://localhost/Flowtime/_vti_bin/Flowtime/ProcessesService.svc/StartWorkflow


Parameters

NameTypeRequiredDescription
workflowIdguidrequiredGUID of the workflow.
variablesValuesarray of key value pairsoptionalContains a key and value pairs. The key is the name of the variable. The value is the value of the variable.
PageSizeintegeroptionalNumber of records returned on a page.
PageNumintegeroptionalNumber of the page to retrieve records for.

Example Request

$.ajax({
      type: "GET",
      url: "/_vti_bin/Flowtime/XsrfTokenService.svc/GetXsrfToken",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      cache: false,
      async: false,
      success: function (xsrf) {
        $.ajax({
          type: "POST",
          url: "/_vti_bin/Flowtime/ProcessesService.svc/StartWorkflow",
          data: JSON.stringify(
            {
              workflowId:"55a022b6-fb3c-4b66-9d50-cac63ed0a0a3", //Id of workflow
              variablesValues:[
                {Key:"var1", Value:1}
                ,{Key:"var2", Value:"abc"}
              ] //the key is name of variables and Value is value of variable.
            }),
          headers:
          {
            "uiculture": "en-GB",
            "culture": "en-GB",
            "theme": "/Flowtime/Shared Resources/Themes/Sequence8/",
            "X-SqXsrfToken":xsrf,
            "config": "Portal"
          },
          dataType: "json",
          contentType: "application/json; charset=utf-8",
          success: function (data) {
            debugger;
            alert("New instance #"+data+" was opened");
          },
          error: function (error) {
            debugger;
            console.log(error);
          }
        });
      },
      error: function (error) {
        console.log(error);
      }
    });