Run vRealize Orchestrator Workflow from PowerCLI

This post is the first of many that will talk about VMware vRealize Orchestrator and the power that can give us to automate our environment.

First things first, let’s see a short description of the product:


VMware vRealize Orchestrator Automates Complex IT Processes, simplifies the automation of complex IT tasks, it can be integrated with vRealize Suite and vCloud Suite to further improve service delivery efficiency, operational management and IT agility. vRealize Orchestrator can be not only integrated with VMware products, vendors integrating their products are growing everyday.


We can find VMware full description at:

We will see in future posts the programming philosophy and the workflow structure used by vRO, but to start, I’m going to deal with the need of running our vRealize Orchestrator workflows from outside of Orchestrator Client to automate even more our IT Processes. Here you can find a聽 script to run a vRO workflow from PowerCLI and monitor the result of the execution:

# Author: Juan Vicente Lopez
# Description: Call vRealize Orchestrator workflow and control exit
# Example: ./Run_Orchestrator_Workflow.ps1 -WorkflowName "Workflow to be executed"


[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}

# First of all connect to vCO and generate Proxy on $vcoWS
$vcoWS = New-WebServiceProxy -Class VCO -Namespace VCO -Uri $vROserver

# Find Workflows with specified name, keep in mind that it returns an array
$workflows = $vcoWS.getWorkflowsWithName($WorkflowName, $user , $password)

if ($workflows -eq $null) {
Write-Host "Workflow does not exist"
exit (1)

# Select the first workflow of the array
$workflow = $workflows[0]

# Execute workflow
$workflowToken = $vcoWS.executeWorkflow($, $user, $password, $null)

# Monitor the execution and return the result
do { Start-Sleep -Seconds 2 }
while ( $vcoWS.getWorkflowTokenStatus(@($, $user , $password) -eq "running")

if ( $vcoWS.getWorkflowTokenStatus(@($ , $user , $password) -eq "completed") {
Write-Host "Workflow successfully executed"
exit (0)
Write-Host "Workflow execution failed"
exit (1)

This is script is just an example of how to deal with the need of running a vRO workflow from PowerCLI.

We can find more ways to work with workflows from PowerCLI, another example is PowervRO, a Powershell module built on top of the services exposed by the vRealize Orchestrator REST API.

You can find more info of PowervRO here:

How to install:

Thanks for sharing 馃檪

Leave a Reply

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