Migratable Endpoint
注記
This help page covers the usage of a Server API endpoint. To get started with the Server API, visit the Server API Overview.
Use the migratable endpoint to migrate workflows across Server environments. You can use this to manage workflow deployments during development and testing phases.
To begin, you have to enable workflows for migration. Once you mark workflows for migration, follow these steps to publish them from the source environment into the appropriate subscription (studio) of a target environment.
Step 1. Get a List of Workflows Ready to Migrate
Next, get a list of workflows ready to migrate using the following endpoint:
Environment: Source
Method: GET
Endpoint: webapi/admin/v1/workflows/migratable/?subscriptionIds={subscriptionIds}/
Include a comma-separated list of subscriptionIds as a query parameter. Subscription IDs identify a specific studio.
The return is an array of workflows marked as ready to migrate under the specified subscription (studio). If you do not provide subscriptionsIds, the return includes all workflows marked as ready to migrate. The return includes 3 properties: appId, the currently published revisionId, and the subscriptionID the workflow belongs to.
Step 2. Download Workflows from the Source Environment
The following endpoint downloads the workflow as a YXZP file.
Environment: Source
Method: GET
Endpoint: webapi/admin/v1/{appID}/package/
Include an appID as a path parameter. The return will be a download of the entire workflow as a package.
Step 3. Publish Workflows in the Target Environment
The following endpoint publishes the downloaded workflow to the target environment.
Environment: Target
Method: POST
Endpoint: webapi/admin/v1/workflows/
Parameters | |||
Parameter | Description | Type | Required |
---|---|---|---|
file | The filename of the new workflow. | String | True |
name | The new workflow name. | String | True |
owner | The owner of the migrated workflow. The email address must exist in the target environment. | String | True |
validate | Flag to validate the workflow upon migrating to the target environment. | Boolean | True |
isPublic | Flag to set the workflow to public to show in “My Company’s Server” in the target environment. | Boolean | True |
sourceId | This is the Source environment appId of the to-be-migrated workflow. If a workflow with the same sourceId exists, the version of the workflow is incremented. Otherwise, a new workflow will be generated. (Send an empty string if you do not wish to specify an appID.) | String | True |
workerTag | Add a worker tag to the workflow to have a specific worker run the workflow. (Send an empty string if you do not wish to specify the worker.) | String | True |
canDownload | Flag to set the workflow as available for download by other users in the target environment. | Boolean | True |
(Optional) Step 4. Reset Migration Setting Workflows in the Source Environment
If you want, you can use the migratable endpoint to toggle the This workflow is ready to be migrated setting on a workflow back to No in the source environment after workflow migration in the target environment.
Environment: Source
Method: PUT
Endpoint: webapi/admin/v1/workflows/migratable/{appID}/