When creating your script for use in vRealize Orchestrator, you must verify that your script has the correct structure and formatting.

Supported Runtimes

For developing vRealize Orchestrator actions and workflows, you can use the following runtimes:

  • Python 3.7
  • Node.js 12
  • PowerCLI 11/Powershell 6.2
  • PowerCLI 12/Powershell 7
    Note: The PowerCLI runtime includes PowerShell and the following modules: VMware.PowerCLI, PowerNSX, PowervRA.

You can add any custom source code to the new runtimes, but to accept context and inputs, and return a result from and to the vRealize Orchestrator engine, you must follow the correct functional format.

Scripting Recommendations

For simpler scripting tasks, you can add Scriptable task elements to your workflow schema. You can use vRealize Orchestrator actions for more complex scripting tasks.

Using actions provides two specific benefits:

  • Actions can be created, updated, imported, and exported independently from workflows.
  • Actions are standalone objects that can be run and debugged in their own environment which can lead to a smoother development process. See Running and Debugging Actions.

Script Function Requirements

The default name for your script function is handler. The function accepts two arguments, context and input. Context is a map object, containing system information. For example, vroURL can contain the URL of the vRealize Orchestrator instance you want to call, while executionId contains the token ID of a workflow run.

An input is a map object containing all inputs that are provided to the actions. For example, if you define an input in your action called myInput, you can access it from the inputs argument, such as inputs.myInput or inputs["myInput"], depending on your runtime. Anything that you return from the function, is the result of the action. Therefore, the return type of your action must correspond to the type of content that the script returns in vRealize Orchestrator. If you return a primitive number, the action return type must be a number type. If you return a string, the action return type must be a string type. If you return a complex object, the return type must be mapped to either Properties or Composite Type. These same principles also apply to arrays.

Supported input and output parameter types for Python, Node.js, and PowerShell runtimes:

  • String
  • Number
  • Boolean
  • Date
  • Properties
  • Composite Type

Define the Entry Handler

By default, the value of the entry handler is handler.handler. This value means that the vRealize Orchestrator engine looks for a top-level file in your ZIP package called handler.py, handler.js, or handler.ps1, that includes a function called handler. Any differences to the names of the function and handler file must be reflected in the value of the entry handler. For example, if your main handler is called index.js and your function is called callMe, you must set the value for the entry handler to index.callMe.

Debug Runtime Scripts in an External IDE

vRealize Orchestrator supports debugging Python and Node.js scripts in an external IDE. You cannot debug PowerShell scripts in an external IDE.