Export and Import Workflows and REST Apps

The Serviceaide Automation provides APIs that enable you to export and import information from one tenant to another. Using the APIs, you can migrate verified and tested data such as workflows, Connected Apps, etc, from one environment to another environment without the need to recreate the information.

Export Workflows and Apps

Using the Export APIs, Automation workflows and REST Apps configured in one tenant can be migrated to another. The API exports the details of the selected workflow and the related elements such as Apps, Instances, Operations, and Service Configurations. A zip file is generated that can be imported to the target environment.

Use the following details to configure API:

  1. Pass the Access Bearer token to API as Header. The Bearer token is generated using Tenant Admin Login API. The Bearer token is valid only for 10 mins. The header should be passed as Header - Authorization: Bearer <Tenant Access Token>.

  2. URI: /gateway/api/v1/export
    For Example: http://itasdevops.automationsaqa1.com/gateway/api/v1/export

  3. HTTP Method for the operation: POST

  4. Send Content-Type: application/json as the Header to the API.

  5. Pass the following as Outbound Payload or Request to the Web Service. The request is passed in the following JSON format.

    [     {         "type": "WORKFLOW_DEFINITION",         "subType": null,         "ids": [78]     } ]
    1. Type: Refers to the Item name to be exported.

    2. SubType: Refers to the sub-entity. Based on the Type selected, add the subType.

    3. Id: Represents the identifier of the specific item to be exported.

Use the below Type and Subtypes to export data from one tenant to another:

  1. Automation Workflow

    1. Type: WORKFLOW_DEFINITION to download Workflow definition, Workflow design, Connected App, Instance, and Operations

    2. Subtype: null (No subtype required)

  2. Integration Applications (REST Apps)

    1. Type: INTEGRATION

    2. Available SubTypes:

      1. Use sub type FULFILLMENT_SYSTEM to download the Connected Apps, related instances and operations.

      2. Use Sub type FULFILLMENT_SYSTEM_INSTANCE to download the the App Instances.

      3. Use Sub type CONNECTOR_OPERATIONS_MAPPINGS to download a specific Operations.

As a response, the web service generates a response that can be saved to your local machine as a ZIP file. The ZIP file contains the exported components and all the related entities. The file can then be imported into another environment using the Import API.

Import Workflows

You can import the ZIP file (created using the Export API) into your target environment using the Import APIs. Import creates the elements and all the related entities in the target environment without the need to create the data.

Use the following details to configure API:

  1. URI: /gateway/api/v1/designer/content/import
    For Example: http://itasdevops.automationsaqa1.com/gateway/api/v1/designer/content/import

  2. HTTP Method for the operation: POST

  3. Pass the following Headers to the API:

    1. Pass the Access Bearer token to API as Header. The Bearer token is generated using Tenant Login API. The Bearer token is valid only for 10 mins. The header should be passed as Header - Authorization: Bearer <Tenant Access Token>.

    2. Content-Type: multipart/form-data. This ensures the API accepts the file attachment as input.

    3. Accept: application/json

  4. Send the ZIP file as an attachment.

As a response, the web service imports the elements in the target system and generates the following response with the import status.

{ "status": "Success", "statusCode": 0, "statusLine": "Successfully created the resource.", "errors": null, "resultData": { "subtenant": { "href": "/api/v1/subtenants/1", "id": 1 }, "href": "/api/v1/resources/264", "id": 264, "tenant": { "href": "/api/v1/tenants/1078", "tenantId": 1078 }, "createdDate": "2022-07-15T13:39:52.015Z", "createdByContact": { "subtenant": {}, "href": "/api/v1/contacts/1", "id": 1, "recordStatus": { "id": 1, "status": "active" } }, "modifiedDate": "2022-07-15T13:39:52.015Z", "modifiedByContact": { "subtenant": {}, "href": "/api/v1/contacts/1", "id": 1, "recordStatus": { "id": 1, "status": "active" } }, "resourceIdentifier": "7b0cda9f-510f-4411-b890-307c6df45615", "name": "1063_Tenanat8992_export_1657884703633.zip", "originalName": "1063_Tenanat8992_export_1657884703633.zip", "resourcePath": "1063_Tenanat8992_export_1657884703633.zip", "resourceSize": 2271, "recordStatus": { "href": "/api/v1/recordStatus/1", "id": 1 } }, "warnings": [], "timestamp": 1657892392857, "reasonPhrase": null, "metaInfo": null }

Upon successful import, the elements are available in the respective sections in the Serviceaide Automation portal.

When importing an instance or operation, the corresponding Connected App should already be available in the target tenant. If the App is not available, the import process fails.