Example - Using IBM webMethods Integration API to run a workflow
Following are the steps on how to use IBM webMethods Integration API to run a particular workflow.
Before you begin
- Log in to your IBM webMethods Integration tenant.
- Create a workflow and save it.
For example, you create a workflow that is named Sample Workflow that creates a board Dev Team Status Board in your Trello account.
To run this workflow by using IBM webMethods Integration API, follow the procedure:
Basic Flow
- Open a REST client and click Create New.
-
On the REST client Request page, click the Authorization tab, and select Basic Auth from the Type dropdown list. Add the authentication details of the tenant that is associated with the workflow that you want to run.
In this example, add the authentication details of the tenant that is associated with the Sample Workflow workflow.
-
To run a workflow by using IBM webMethods Integration API, the Workflow APIs - Execute section is referred.
Perform a POST request at the URL of the workflow that you want to run. Use the URL Syntax:
<domain>/apis/v1/rest/projects/:project/workflows/:workflow/runIn this URL syntax,
- domain is the tenant URL provided by IBM webMethods
Integration, for example
https://sample-tenant.int-aw-us1.webmethods-int.io. - /: project is the name of the project that is associated with the workflow that you want to run, for example, Sample_Project.
- /: workflow is the UID of the workflow that you want to run, for example,
fla95fc030gfb181194bb363.Note: To retrieve the UID of the workflow, in IBM webMethods Integration, navigate to the workflow you want to run. Your tenant URL looks like this:
https://sample-tenant.int-aw-us1.webmethods-int.io/#/projects/fl102d2ad2e4r7d78b1811ea/workflows/fla95fc030gfb181194bb363/edit. The UID of the workflow is the alphanumeric characters that appear after /workflows in the URL. Here, the UID of the workflow isfla95fc030gfb181194bb363
- domain is the tenant URL provided by IBM webMethods
Integration, for example
-
Click Send to run the workflow.
On successful execution, you can see the output in the REST client interface.
-
Check the execution logs in the Workflow Execution screen on the Monitor page. You see that the workflow is run. You can click the name of the workflow to get the complete information on the performance of the workflow.
If you check the workspace in your Trello account, you see a new board that is named Dev Team Status Board added to the list of existing boards.
Note: You can save the API requests in the REST client collections for future use.