Importing and exporting workflow configurations

Use API to transfer workflow configurations from one system to another.

Before you begin

The following constraints must be fulfilled:
  1. All user groups which are defined on the source system and are used in the transferred configurations must exist on the destination system as well. The groups are matched by group name during import.
  2. All users which are defined on the source system and are used in the transferred configurations must exist on the destination system as well. The users are matched by user name during import.
  3. All categories which are defined on the source system and used in the transferred configurations must exist on the destination system as well. The categories are matched by category name during import.
The export and import requests require the following entries in the request header:
  • "Authorization" with a valid token.

    To authenticate to APIs, you must generate an API key, as described in Generating API keys for authentication.

  • Accept=application/json
  • Content-Type=application/json; charset=UTF-8

For more information on API, see https://cloud.ibm.com/apidocs/knowledge-catalog-cpd.

Procedure

  1. To export the configurations as a JSON object, use the following API request on the source system:
    GET https://<myHostname>:<myPort>/v3/workflow_configurations?isExportToAnotherSystem=true&is_active=true&workflow_type_id=<myWorkflowTypeId> 
    where:
    • workflow_type_id defines the workflow type for which the configurations are exported, for example: 82d2f01f-9df1-4d67-96e5-ecbcadf24e5c
    • is_active=true limits the result to active configurations
    • isExportToAnotherSystem=true prepares the result for the subsequent import.
  2. To import the configurations on the destination system, use the following API request:
    POST https://<myHostname>:<myPort>/v3/workflow_configurations/import?preview=false

    The request returns a list of affected configurations on the destination system which are modified during import.

    If you use the parameter preview=true, the IDs of the affected configurations are returned, but no configurations are imported and no existing configurations are modified.