When creating your script for use in Automation Orchestrator, you must verify that your script has the correct structure and formatting.
Supported Runtimes
For developing Automation Orchestrator actions and workflows, you can use the following runtimes:
- Python 3.10
- Node.js 20
- PowerCLI 13 (PowerShell 7.4)
Note: The PowerCLI runtime includes PowerShell and the following modules: VMware.PowerCLI, PowerNSX, PowervRA.
- PowerShell 7.4
Note: The PowerCLI 12 and Node.js 18 runtimes are deprecated and will be removed in a future release.
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 Automation 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 Automation 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 Automation 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 Automation 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 Automation 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
Automation Orchestrator supports debugging Python and Node.js scripts in an external IDE. You cannot debug PowerShell scripts in an external IDE.