Import into an existing workflow

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

Request

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

Request Parameters

The following table describes required and optional required 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.

id

Required. A GUID that represents the identifier of the workflow into which the export file is to be imported or migrated.

migrate

Optional. If included, 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. Specifies 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.

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 existing workflow, and the _links property contains links to other relevant operations of the existing workflow, relative to the SharePoint site.

Remarks

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, even if it was published prior to performing the operation.

Example

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

Request

The following PUT request attempts to import an existing workflow from an export file specified in the request body.

https://crestan.nintexo365.com/api/v1/workflows/packages/99777373-a65a-4f49-af7a-f28c2f33a0a8

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 200 response code is returned, indicating that the existing workflow was successfully imported.

Response Body

The response body contains the following Message object, in which the identifier for the existing 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 existing workflows

Publishing workflows

API Reference