Challenge:

The customer is using Service Now and wanted to integrate approvals in vRealize Automation. So, when a deployment in kicked off from Service Broker, it has to proceed only when the manager approved the request. The manager could take up-to few days to approve the request.

Solution:

We decided to use vRealize Orchestrator to create a workflow that triggers a SNOW api call. The workflow will trigger a call to SNOW which generates a approval request for the manager and returns the request number back to vRO in the request response. This workflow then waits for the approval. We have used the “wait for custom event” element to do this. This element waits for the request number to returned back from SNOW before proceeding. Then we created an action that sends the custom event. Once, the manager approves the request, the flow in SNOW triggers the vRA api and runs the action we created with the request number as the input. This action will send the custom event and the workflow will run after this.

This is how I have emulated it in my lab since I do not have an instance of Service Now running.

I have created a input that will be the “request number”. During the creation of the deployment I enter the dummy request number in that field.

I have created a subscription workflow that will run during deployment requested and passes the request number to “eventName” variable in the “Wait for custom event” element. The workflow will wait until this request number is sent via the “sendCustomEvent” method.

Once I have submitted the deployment request, the workflow is in waiting stage.

In prod, a service now api will be triggered at this stage that will raise an approval request to the owner and upon approval, service now will trigger an action that will “sendCustomEvent” which will move the workflow along. But, I will be using postman to trigger the action via an api call. This action takes the eventName which is request number in our case and sends the custom event.

The POST api url is https://vraurl/{action id}/executions. The request number will be passed in the body.

Once that action in triggered, the wf moves along.

Here is a short video outlining the process.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *