The Service Library was introduced in vCloud Director 9.1 and allows you to publish vRealize Orchestrator Workflows to your Tenants and/or Service Providers.
There must be a thousand use cases for this scenario and many of them would require one thing: scope limitation. To keep it simple, let’s say you want to provide a Workflow which collects VM data, generates a fancy report and sends it via email to the requestor. The user should be able to select the vApp for which the report will be created.
That short sentences already deliver some interesting requirements:
Number 3 is the interesting one because it requires the Workflow to make use of the request context before the Workflow itself is running.
If you create a Workflow that only logs out all available parameters, you will see this when running it from the Service Library:
_vcd_sessionToken: a long and boring string
Not bad, but we need this information before execution.
So what happens if you add a Workflow Input Parameter that matches one of those names? This:
As you can see, when starting the Workflow from the Service Library, the information is already in there.
In order to create a Workflow for my example use case, the following steps would be necessary:
And that’s it. You can now limit the scope by presenting only objects that exist within the requestors Organization.