Validating workflows and finding references
Workflows call actions, other workflows and configuration elements. Change one, and something else can break without telling you. Three buttons at the top of the workflow editor help: Validate looks for mistakes inside one workflow, Find usages lists everything that calls it, and Find dependencies lists everything it calls. Use the first before every run, and the other two before every change or delete.
Getting ready
- The workflows from recipes 3.1 to 3.9, in VCF Orchestrator Guide/Chapter 3. The more of them you built, the more the usage lists show.
- A minute to build a workflow with three mistakes in it.
How to do it
Let the editor find the mistakes
- Create a workflow called
Describe a VM with mistakesin VCF Orchestrator Guide/Chapter 3, with an inputvm(VC:VirtualMachine) and an outputsummary(string). - Add a variable
oldTimeout(number) and don’t use it anywhere. That’s mistake one. - Add a scriptable task
Describe itthat readsvmand writessummary:
summary = vm.name + ": " + vm.summary.config.numCpu + " vCPU";- Drag a second scriptable task,
Log the summary, onto an empty part of the canvas, give it an inputsummarybut don’t bind it (mistake two), and draw an arrow from it to the end element. Nothing leads to it (mistake three). - Click Validate at the top of the editor. A table opens below the canvas with one row per issue: Severity, Object, Message and Details. A warning icon also appears on the element at fault.

- Fix them: delete
oldTimeout, deleteLog the summaryor connect it afterDescribe itand bind its input. Click Validate again until the table is empty. - Click Save. If anything is still wrong, the editor asks Validation is not successful. Are you sure you want to continue? View details shows the same table; Continue anyway saves regardless.
See what calls a workflow
- Open
Describe a VM, the workflow from recipe 3.1 that later recipes reuse, and click Find usages.

The Location column says where the reference is: an element of the schema (Workflow Schema : item4), a variable (Attribute : describeWorkflow), or several places at once (Multiple references, expand the row to see them). Scheduled tasks count too: the row of type Task is the run that Describe a VM later scheduled in the schema element reference.
See what a workflow calls
- Open
Describe a running VM(from the schema element reference) and click Find dependencies. It lists the actiongetVmFactsand the workflowDescribe a VM, each with the element that uses it.

How it works
Validate reads the workflow’s schema without running it. It reports elements that no path reaches, element inputs left unbound, variables and parameters nobody uses, and similar wiring problems. It can’t see inside scripts: a typo in a variable name or a call to a method that doesn’t exist only shows up when the script runs. For those, run the workflow, or check the script against the API reference before you save it.
The 9.1.1 validator marks most problems as warnings, not errors, which is why Continue anyway is offered. Treat every warning as a bug until you’ve read it.
Find usages and Find dependencies search the server’s content for references: in schema elements, in variables of type Workflow or Action, in scheduled tasks, and in scripts. A script that calls an action as System.getModule("com.vcfguide.chapter3").findVmsByName(...) is listed with the element and the line number (figure 4.5 in Chapter 4). What they can’t follow is a reference built while the script runs, such as a module name put together from variables, or a workflow ID read from a configuration element. So before you delete something, also search your scripts and configuration elements for its ID and name, for example in a package export (chapter 6).
There's more
Actions have two of the three. An action’s editor has Find usages and Find dependencies, but no Validate. Find usages is the quickest way to see which workflows break when you change an action’s inputs, including the scripts that call it.
Before you delete. Run Find usages, fix or remove each caller, then delete. A deleted workflow goes to Deleted Items, where you can restore it if you were wrong.
Keep the example. Describe a VM with mistakes is useful for showing a colleague what validation looks like. Don’t run it; its description says so.
