Import into a new workflow

Imports the contents of a Nintex Workflow for Office 365 export (.nwp) file into a new workflow.

Request

Method Request URI HTTP Version
POST https://{baseURL}/api/v1/workflows/packages[?{migrate}][&{listTitle}] HTTP/1.1

Request Parameters

Request Parameter Description

baseURL

Required. The base URL for the Nintex Workflow for Office 365 REST API. For more information about the base URL, see Base URL.

migrate

Optional. A Boolean that indicates whether the operation attempts to map metadata within the export file to the corresponding values for the SharePoint site specified in the request header. If not specified, the default value is true.

For more information about migrating workflows, see Importing into existing workflows.

listTitle

Optional. A string that represents the title of the SharePoint list into which the list workflow is migrated, overriding the list specified in the export file. This parameter is ignored for list workflows if migrate is set to false. If not specified, the default value is null.

An error occurs if this parameter is specified when importing or migrating a site workflow.

Request Headers

This operation uses only common request headers. For more information about common request headers, see Common headers.

Request Body

This operation uses the contents of an export file, represented as a Base64-encoded binary value, in the request body.

Response

This operation returns an HTTP status code, response headers, and a response body.

Response Codes

This operation returns only common HTTP status codes. For more information about common HTTP status codes returned by all operations, see Common status and error codes.

Response Headers

This operation returns only common response headers. For more information about common response headers returned by all operations, see Common headers.

Response Body

If the operation was successful, the response body contains a Message object that represents the information returned by the operation about the imported workflow. Otherwise, the response body contains an Error object, which provides information about the error response. For more information about the Message and Error objects, see Response bodies.

For a successful response, the id property of the Message object represents the identifier of the new workflow, and the _links property contains links to other relevant operations for the new workflow, relative to the SharePoint site.

Remarks

Use this operation to import or migrate a new workflow to a SharePoint site or list, by creating a new workflow and importing or migrating the contents of an existing export file into the new workflow.

If migrate is set to true, the operation performs the following actions:

If migrate is set to false, the operation performs the following actions:

To support Nintex Forms integration, Nintex Forms for Office 365 version 1.2.1.0 or greater must be installed.

If this operation is successful, the workflow must be published before it can be used.

Example

The following example demonstrates how to use this operation to import a new workflow from an export file.

Request

The following POST request attempts to import a new workflow from an export file specified in the request body.

https://crestan.nintexo365.com/api/v1/workflows/packages

Request Body

The request body for the example contains a Base64-encoded binary value that represents the contents of the export file to be imported.

Response

An HTTP 201 response code is returned, indicating that the export file was successfully imported into a new workflow.

Response Body

The response body contains the following Message object, in which the identifier for the new workflow is specified in the id property and the operations relevant to the new workflow are described in the _links property.

{
  "id": "99777373-a65a-4f49-af7a-f28c2f33a0a8",
  "_links": [
    {
      "rel": "self",
      "href": "/api/v1/workflows/packages{?migrate,listTitle}",
      "isTemplated": true
    },
    {
      "rel": "workflow.package.export",
      "href": "/api/v1/workflows/packages/99777373-a65a-4f49-af7a-f28c2f33a0a8",
      "isTemplated": false
    },
    {
      "rel": "workflow.publish",
      "href": "/api/v1/workflows/99777373-a65a-4f49-af7a-f28c2f33a0a8/published",
      "isTemplated": false
    }
  ]
}

Related Information

Importing into new workflows

Publishing workflows

API Reference