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:
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>.
URI: /gateway/api/v1/export
For Example: http://itasdevops.automationsaqa1.com/gateway/api/v1/exportHTTP Method for the operation: POST
Send Content-Type: application/json as the Header to the API.
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] Â Â Â Â } ]
Type: Refers to the Item name to be exported.
SubType: Refers to the sub-entity. Based on the Type selected, add the subType.
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:
Automation Workflow
Type: WORKFLOW_DEFINITION to download Workflow definition, Workflow design, Connected App, Instance, and Operations
Subtype: null (No subtype required)
Integration Applications (REST Apps)
Type: INTEGRATION
Available SubTypes:
Use sub type FULFILLMENT_SYSTEM to download the Connected Apps, related instances and operations.
Use Sub type FULFILLMENT_SYSTEM_INSTANCE to download the the App Instances.
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:
URI: /gateway/api/v1/designer/content/import
For Example: http://itasdevops.automationsaqa1.com/gateway/api/v1/designer/content/importHTTP Method for the operation: POST
Pass the following Headers to the API:
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>.
Content-Type: multipart/form-data. This ensures the API accepts the file attachment as input.
Accept: application/json
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.