webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

Tech Bytes IWHI: Automation for asset deployments in webMethods.io Integration 

8 days ago

Introduction 

This article will demonstrate  how to deploy the assets of webMethods.io Integration assets using public APIs. 

Pre-requisites 

  • A webMethods.io Integration tenant.
  • Administrator access to the webMethods.io Integration platform to execute APIs. 

Audience 

This article is intended for Integration architects and developers working with  webMethods. 

Use case 

The client has developed assets on their development tenant. Their platform team aims to streamline and automate the deployment of these assets to higher environments by leveraging APIs. 

 Approach  

There are several ways to automate the process of deploying assets. 

Approach 1: Asset deployment at project level 

Steps to be followed 

  • Export Project assets 

  • Export project configurations 

  • Create  a new project  

  • Import configurations 

  • Import Assets

 

Picture 

 

Note: For all API invocation we need to use the API key, which needs to be generated from the tenant and this needs to be passed in headers.

Key name: X-INSTANCE-API-KEY 

Value: Will get generated from the tenant 

 

Step 1: Export Project Assets from Source Tenant 
This API allows you to export all assets developed within a project. The export is provided as a downloadable file, and the response includes a link to the file. The link is valid for a limited period, with the validity duration specified in the response. 

Examples of Assets: 

  • Workflows
  • Flow Services
  • Custom Connectors 

API Details: 

Method: POST 

URL: https://<TenantName>/apis/v1/rest/projects/<projectID>/export 

Request Payload: None 

Picture 

Step 2: Export Project Configurations from Source Tenant 

This API enables the export of project configurations, including connector settings, global variables, certificates, and other relevant 

API Details: 

  • Method: GET 

Request Payload: None 

Sample Response payload: 

 

"output": {  

"apiVersion": "1.0" 

"metadata": {  

"source": "originawsdev1" 

"project": "fl5a3a590ea461f56597c0a5" 

"generatedOn": 1752490096890  

},  

"configurations": {  

"packages": [],  

"variables": [],  

"connections": [],  

"certificates": [],  

"servicesSchedule": []  

},  

"globals": {  

"alertRules": [],  

"versionControlAccounts": [  

 

"type": "github" 

"hostname": "github.ibm.com" 

"credentials": {  

"username": "Vikash-Sharma5" 

"accessToken": ""  

},  

"displayName": "vikashIBMgithub" 

"owner": "vikash" 

"isValidToken": true  

},  

 

"type": "azurerepo" 

"hostname": "dev.azure.com" 

"credentials": {  

"username": "vikashSharma5" 

"accessToken": ""  

},  

"displayName": "vikasAzureRepo" 

"owner": "viksh" 

"isValidToken": true  

 

 

 

 

}

Step 3: Create project on target tenant (Optional): 

This is an optional step to be executed if the project is not already available in the target tenant. The project can be created in the target tenant using the same project ID as the source tenant. Using the same project ID ensures that the ID references in the configurations and assets exported are automatically handled. Refer to the API details below. 

API Details: 

  • Method: POST 

  • URL: https://<Tenant URL>/apis/v1/rest/projects 

Request payload: 

 

 

"name": "LogisticsAssets" 

 

"uid": "fla221ab7f8cdb8b22cf3ffm"  

 

} 

 

Response payload 

 

 

"output": {  

 

"name": "LogisticsAssets" 

 

"uid": "fla221ab7f8cdb8b22cf3ffm" 

 

"tenant_uid": "fl4c27abef2ef70d742812e3" 

 

"workflow_count": 0 

 

"flowservice_count": 0 

 

"created_at": "2025-07-14T11:53:36.815Z" 

 

"updated_at": "2025-07-14T11:53:36.815Z"  

 

 

 

} 

 

  • In case if we are creating the version control source project then also all workflow and flow services assets will still reside on internal git. 

Step 4: Import configurations target tenant:  This API facilitates the import of configurations into the target tenant. Importing configurations before importing assets ensures that all asset references are intact and ready for use during the asset import process. 

Key Considerations Before Importing Configurations: 

  1. Environment-Specific Configuration Values: 

    • Modify environment-dependent values for configuration assets, such as global variable values, before importing them. 
  1. Individual Configuration APIs: 

    • While the export process includes all configurations, there are separate APIs available for each configuration type. You can use these individual APIs to update specific configuration values as needed. 
  1. Certificates: 

    • If your implementation involves certificates, it is recommended to use the Create API for certificates to generate them on the target tenant. 
    • If certificates are being created in a keystore or truststore, ensure that their names remain unique across all projects. 
  1. Custom Connectors: 

    • Custom connectors, such as REST connectors, are treated as assets rather than configurations. 
    • If a custom connector is not used in any flow service, it will not be included in the export. 

API Details: 

Method: POST 

URL: https://<TenantName>/apis/v1/rest/projects/<ProjectID>/configurations 

Picture 

Step 5: Import Assets target tenant 

This API imports the assets into the target tenant. The file that was exported in step 1 is to be sent as an input to this API. 

API Details: 

Method: POST 

Headers: 

Content-Type: multipart/form-data 

X-INSTANCE-API-KEY : <value generated from tenant> 

Request Payload 

Body Type: multipart 

Project: zip export of project 

new_project_name: <name of the project> 

Picture 

 Response Payload 

{ 

"output": { 

"status": "IMPORT_SUCCESS" 

} 

} 

 

Step 6: [Optional] Validation Step End to End Testing target tenant: After the importing of assets, we should be able to execute the flow services and workflow on our target tenant. 

Invoke flow service: 

METHOD:POST 

Flow service invoke URL:  

 

Picture 

Approach 2: Deploying the individual assets and configurations 

  • In this approach all the assets are not bundled as a single zip but here it will be more of cherry pick approach. 
  • For example, suppose if you have changed a single flow service and configurations related to it then to push those changes you need to explicitly invoke those API’s one after another. 

 

Use case:  Developer has modified the assets to implement some functionality. 

Assets Modified: 

  • Flow service 
  • Global variable 
  • Created the new connection 
  • Certificate 

 

So in this case we need invoke the API for each of them explicitly.  

 Flow service: 

Export flow service: 

METHOD: POST 

API: URL: https://<TenantName>/apis/v1/rest/projects/flows/<flowserviceName>/export 

 

Picture 

 

Import flow service: 

METHOD: POST 

API: URL: https://<TenantName>/apis/v1/rest/projects/flow-import 

 

Request Body: multipart type 

Recipe: zip file for exported flow service asset 

 

Picture 

 

Add  global variable 

METHOD : POST 

URL: <Tenant URL>/apis/v1/rest/projects/<ProjectID>/variables?type=projectVariable 

Request Body: 

{ 

  "key": "username", 

  "value": "viksh", 

  "isPassword": false, 

  "isGlobal": false 

} 

 

 

Picture, Picture 

 

Update variable 

METHOD : PUT 

URL: <Tenant URL>/apis/v1/rest/projects/<ProjectID>/variables?type=projectVariable 

Request Body: 

{ 

  "key": "username", 

  "value": "vikshNew", 

  "isPassword": false, 

  "isGlobal": false 

} 

Note: All the types of variables can be handled using these API’s. We just need to provide the correct variable type like project variable, package variable 

Picture 

 

Create connection: 

  • To create the connection in the target tenant we require json body to pass as payload. 
  • Easy way to generate the Json body is to invoke the get connection API for your source tenant and then modify the same Json body to create the connection in target tenant.  

Note : This is not mandatory, it just a way to get the payload ready quickly and efficiently. 

 

Get connection details: 

METHOD: GET 

URL: https://<TenantName>/apis/v1/rest/projects/<projectID>/configurations/connections 

 

Picture 

Now use the above response payload as base and modify it so that same can be passed as request payload for creating the connection. 

 

METHOD: POST 

API: https://<TenantName>/apis/v1/rest/projects/<projectID>/configurations/connections 

 

Payload Sample: 

{ 

"name": "ConnectionName", 

"type": "connection", 

"source": "", 

"sourceMetadata": { 

"authenticationScheme": "credentials", 

"connectionType": "", 

"connectorID": "", 

"providerName": "", 

"type": "", 

"adapterID": "" 

}, 

"uid": "uconn7a34853ce8d06f009c5c37454eb7ecb832bf04c5", 

"data": { 

//Paste actual connection details 

} 

}

Picture, Picture 
 

Note: We offer different types of connectors like node.js connectors, cloud stream connectors and adapters. In the above payload some of the values like (type, provider name, connection Type) will differ based on which type of connector we are planning to create 

Create Certificate 

METHOD: POST 

Request body: Multipart Type 

Sample for multipart type 

 

CertificateProperty 

 

{"certificateType":"KEY_STORE","certificateConfig":{"name":"AnyName","description":"keystore desc","type":"JKS","provider":"SUN","password":" ReplacewithPassword ","projectName":"ReplacewithprojectID","keyAliases":[{"alias":"test","password":"ReplacewithPassword"}]}} 

 

File: upload the jks file. 

Picture 

Note: Keystore and truststore name should be unique across the project. 

 

Points to remember 

  • Approach 2 is recommended when developer is aware of what specific assets need to be updated or modified. 
  • As we need to update each asset explicitly by invoking the API’s, It is recommended to announce upgrade downtime for the target tenant till this activity completes.  
  • If we are updating any global variables and those global variables are getting used in connector account configuration. Them we need to disable and enable the account to get the new value come into effect at connector level. 

 

 

 

 

Statistics
0 Favorited
5 Views
0 Files
0 Shares
0 Downloads