Workflow REST API

You can use the Workflow REST API to programmatically interact with workflows, for example starting new workflows, retrieving workflow tasks, and completing workflow tasks.

You will need to enable the Workflow API through the Management site before the REST API will be available, please see Configuring the Workflow REST API in the user guide for more information on enabling the endpoint as well as list of the available endpoints and their descriptions .

The Workflow REST API provides a downloadable JSON (Swagger ) file, which you can download from the Management Site where the API is enabled, as shown below. You can parse this JSON file for documentation about the various endpoints, methods and properties exposed by the API. You can also click the Open Link button to launch the swagger documentation interface for the API, where you will be able to test the methods exposed by the API as well.

The URL for the REST API is specific to your environment, and is shown in the Base URL field. You will need to use this URL in your code to when interacting with the API.

You can find code samples that demonstrate how to use this API in the Workflow REST API Code Samples topic.

Considerations

  • Use the Swagger descriptor to discover the capabilities of the REST endpoints. The Swagger file is accessible from the Workflow API configuration page in the Management site.
    • Use the Tasks endpoints to list and action your tasks.
    • Use the Workflows endpoints to list and start instances of workflows. The Authorization Framework trims what's exposed and shows workflows that you have Start rights on.
  • The Workflow REST API supports Cross Origin Resource Sharing. CORS is a way to protect authentication within a browser, against an API, system or data source that doesn't exist in the same domain that the browser's context runs. For example, you may build a web app that runs locally and needs to hit the Workflow API that would be publicly exposed by Nintex K2 Cloud. You need to set up an entry in the CORS, Domains Allowed section of the API configuration page for where your code runs (your local domain, for example http://localhost and http://localhost:3000).
  • For information on enabling and using Workflow REST API logging, see the Auditing and Logging topic in the Installation and Configuration Guide.
  • We don't support multiple file upload, but we do support uploading a single file as a file data type.
    "parameters": [
    {
    "in": "formData",
    "name": "file",
    "type": "file"
    }
    ],
    The method used would then have to only accept a single file, instead of an array for uploading files.

    For more information on the Swagger File uploading see: Swagger file upload.