Skip to content

Folders, modules, and names

Six months after you deliver a solution, someone opens the Orchestrator Client and sees two hundred workflows. A good name tells them, without opening anything, what a workflow does, who owns it, how it’s started, and whether they’re allowed to run it. This recipe sets out a naming standard that does that, and applies it to the decommissioning solution from recipe 9.1.

The standard comes from the author’s own delivery work, with neutral sample names. It builds on the naming advice in VMware’s vRealize Orchestrator Coding Design Guide (2016). Use it as it is, or as a starting point for your own; what matters is that a team picks one and keeps to it.

Getting ready

  • Permission to create workflow folders, action modules and configuration elements.
  • The decommissioning solution from recipe 9.1, or any set of workflows you want to tidy up.

How to do it

Choose your codes

  1. Pick a short owner code, 2 to 5 capital letters, for the team or organization the content belongs to. This chapter uses VCFG. In module names it becomes the lower-case root com.vcfguide.
  2. Pick a second code for shared content: workflows and actions any team may reuse, such as a generic REST helper. This chapter uses CORE, with the module root com.vcfguide.core. Shared content never calls owner content; owner content may call shared content.
  3. Pick the domains you’ll group work by: what a workflow acts on, not the project phase it was written in. The decommissioning solution needs VM, Mail and CMDB.

Build the folder tree

  1. Under your top workflow folder (here VCF Orchestrator Guide/Chapter 9), create one folder per way a workflow is started, each with a number so they stay in order, and a folder per domain inside:
Workflow folders
VCF Orchestrator Guide/Chapter 9/
├── 01 Catalog/VM ← started by users, from the VCF Automation catalog or the client
├── 02 Subscriptions/VM ← started by VCF Automation extensibility subscriptions
├── 03 Day2/VM ← day-2 actions on deployed resources
├── 04 Library/VM ← building blocks called by other workflows, not run by people
├── 04 Library/Mail
├── 05 Utilities ← tools for administrators: setup, reports, clean-up
└── 99 Test ← test workflows and [TEST] copies; never in a production package
Figure 9.4. The chapter 9 workflow folders in the Orchestrator Client.

Name each kind of object

  1. Name every object with the pattern for its kind:
Object Pattern Example
Workflow <CODE> - <Domain> - <Verb Object> VCFG - VM - Decommission VM
Library workflow <CODE> - LIB - <Verb Object> VCFG - LIB - Power Off VM
Subscription workflow <CODE> - EBS - <Topic> <Pre|Post> - <Purpose> VCFG - EBS - CompRemove Pre - Update CMDB
Test copy the name, then [TEST], in 99 Test VCFG - VM - Decommission VM [TEST]
Action module com.<org>.<domain>[.<sub>] com.vcfguide.vm, com.vcfguide.core.rest
Action verbObject, camelCase powerOffVm, waitForTask
Inputs, outputs, variables camelCase, with the unit where there is one vmName, diskSizeGb, timeoutSec
Configuration element folder <CODE>/<Domain>, name <CODE>_<System>[_<Env>] VCFG/VM › VCFG_Decommission_Prod
Resource element folder <CODE>/<Type>, name <code>-<purpose>.<ext> VCFG/Templates › vcfg-decommission-mail.html
Plug-in endpoint (REST host, SSH host, database) <CODE>-<System>-<Env> VCFG-CMDB-Prod
Action environment <code>-<runtime><version>-<purpose> vcfg-python314-requests
Package the module root plus the use case com.vcfguide.vm.decommission
Package export file <package>_v<x.y.z>_<yyyymmdd>.package com.vcfguide.vm.decommission_v1.2.0_20261201.package
Log line prefix [<CODE>][<workflow or action>] [VCFG][powerOffVm] Powering off vcfguide-test-01
  1. Name the VCF Automation objects that call your workflows the same way, so that you can follow a request from the portal to the code:
VCF Automation object Pattern Example
Project <CODE>-<Purpose> VCFG-Lab
Cloud template <CODE> - <Workload> - <Variant> VCFG - Linux - Small
Extensibility subscription <CODE> - <Topic> <Pre|Post> - <Purpose> VCFG - CompRemove Pre - Update CMDB
Custom resource type Custom.<CODE>.<Object> Custom.VCFG.DnsRecord
Resource action <CODE> - <Verb Object> VCFG - Decommission VM
Policy <CODE> - <Policy type> - <Scope> - <Purpose> VCFG - Approval - VCFG-Lab - Decommission

The topic codes keep subscription names short: CompAlloc (compute allocation), CompProv (compute provision), CompRemove (compute removal), CompReconf (compute reconfiguration), NetConf (network configuration), DeplReq (deployment request) and DeplAction (deployment action).

Keep to the rules that make names work

  1. Check each name against these rules before you save:

    • No versions, dates, or initials in a name. Orchestrator keeps versions itself (recipe 6.1); Decommission VM v2 (MG) ages badly.
    • ASCII letters, digits, spaces and hyphens only, plus underscores where the pattern uses them. Configuration element names can’t contain dots (checked on 9.1.1), and plain ASCII names are safe in every tool that reads exports.
    • Display names under 60 characters, so they fit the client’s lists and the VCF Automation catalog.
    • No two workflows with the same name, even in different folders. Orchestrator tells them apart by ID, but people search by name.
    • No camelCase in workflow names, and camelCase everywhere in code: no underscores in variables, no type prefixes such as iCount or strName, and no numbered names such as vm1 and vm2 (vmSource and vmTarget say more).
  2. Search for duplicates after a big change. In the client, type the verb and object (for example Power Off VM) in the Library > Workflows search and check that only one workflow comes back. From a script:

Find workflows that share a name
// ES5: list workflow names used more than once
var all = Server.findAllForType("Workflow");
var seen = {};
var duplicates = [];
for (var i = 0; i < all.length; i++) {
var name = all[i].name;
if (seen[name] === 1) {
duplicates.push(name);
}
seen[name] = (seen[name] || 0) + 1;
}
System.log("Workflow names used more than once: " + (duplicates.length ? duplicates.join(", ") : "none"));
Needs a lab check. Not yet run on 9.1.1: the duplicate check in step 8 (how long Server.findAllForType(“Workflow”) takes on a server with all the built-in library workflows, and whether built-in duplicates such as Get virtual machines by name show up), and the folder tree and names in steps 4 to 6, for Figure 9.4.

How it works

A name answers four questions. The owner code says whose it is, and so who to ask before changing it. The folder says how it’s started, and so who might be affected: a workflow in 02 Subscriptions runs inside every VCF Automation deployment that matches, so a change to it is a change to provisioning. The domain says where to look for related work. The verb and object say what it does.

Modules by function, not by phase. An action module such as com.vcfguide.phase2 tells nobody anything a year later, and fills up with unrelated actions. com.vcfguide.vm and com.vcfguide.cmdb group actions the way people look for them, and line up with packages (recipe 9.5).

Shared content stays clean. Keeping CORE content free of calls into VCFG content means a CORE package imports cleanly anywhere, on its own. If a shared action needs something owner-specific, pass it in as an input.

The name is the first line of documentation. VMware’s guide suggests that if you can’t name a workflow element in a few words, it probably does too much. The same goes for workflows and actions: VCFG - VM - Decommission VM And Update CMDB And Mail Owner is three workflows.

There's more

Renaming existing content. Workflows are found by ID, so renaming a workflow doesn’t break the workflows that call it. Actions are called by module and name, System.getModule("com.vcfguide.vm").powerOffVm(vm), so renaming an action or moving it to another module breaks every caller. Use Find usages (recipe 3.10) first, and change the callers in the same release.

Needs a lab check. Check on 9.1.1: that renaming a workflow keeps the Workflow elements in calling workflows working, and what Find usages lists for an action called with System.getModule().

The book’s own examples. Chapters 1 to 8 use one folder and one module per chapter, such as com.vcfguide.chapter8, so you can find each chapter’s examples quickly. That’s a convenience for a book, not a pattern for real content.

See also