In this article I explain how to execute a vRealize Orchestrator workflow by invoking a REST method from a REST client.
Sources used for this article are How to use the REST API to Start a Workflow from vCOteam.info and the Orchestrator REST API documentation that you can find on your own Orchestrator server at this url: https://yourvcoserverFQDN:8281/vco/api/docs/index.html
Requirements
A requirement for this article is to have Google Chrome installed. It is possible to use the REST API from other systems but to follow the step by step instructions in this article I have chosen a client that runs inside of Google Chrome.
Also the article is based on vRealize Orchestrator 5.5
Install the Google Chrome Advanced REST client
Perform a Google search for: google chrome advanced rest client. Most likely the first search result will be the client you need. Install this client into your Chrome browser. After installing the application in your browser access it from the apps-url chrome://apps
Next the first thing to do is connect to your Orchestrator server on the api-url. Perform a GET operation on the url that will list all the workflows: https://yourvcoserverFQDN:8281/vco/api/workflows
The first that you access the host you will be asked for credentials for your Orchestrator server
When this is successful you will see a 200 OK message and output with a listing of all your workflows. In the output that lists all the workflows find the workflow that you want to run to to find the workflow ID.
You can also find the ID from the Orchestrator client
Now that we have the workflow ID we can execute the workflow. Invoke a POST method to the following URL, where you replace the ID with the ID of the workflow you want to execute:
https://yourvcoserverFQDN:8281/vco/api/workflows/fef4170e-3b14-42fd-af2e-beabaa9e936a/executions
In the example image below the workflow is executed without parameters. In the payload window enter {} and make sure to change the application type to JSON. Since Orchestrator works with Javascript we need Javascript Object Notation (JSON) to send data with a POST method.
It is also possible to pass parameters to your workflow, here is a JSON-example that was used in the image below.
{"parameters":
[
{
"value": {"string":{ "value": "wow it works"}},
"type": "string",
"name": "param1",
"scope": "local"
}
]}
In the example workflow I have used a scripting element with only one line of code: System.log(param1) that writes the result into the log.