If you want to call a vRealize Orchestrator workflow asynchronously and then retrieve the results of the completed workflow at a later point, you can use the WaitForVcoWorkflowCompletion
activity.
About this task
The WaitForVcoWorkflowCompletion
activity blocks execution of the IaaS workflow until the vRealize Orchestrator workflow has completed or a timeout is reached. The activity returns the results of the vRealize Orchestrator workflow if it completes successfully, an error if the workflow fails, or null if the workflow times out.
Procedure
- In vRealize Automation Designer, open a workflow where you have used the
InvokeVcoWorkflowAsync
activity.
- Navigate to the context where you want to retrieve the results of the vRealize Orchestrator workflow.
- Drag the
WaitForVcoWorkflowCompletion
activity into the Designer pane.
- In the Properties pane, specify the name of the variable representing the virtual machine ID in
VirtualMachineId.
The customizable workflows contain a variable by default named virtualMachineId
that is set during initialization.
- Create a variable of type DynamicOps.VcoModel.Common.VcoWorkflowExecutionToken.
- Create a variable of type
DynamicOps.VcoModel.Common.VcoWorkflowExecutionToken
.
- Specify the name of the token variable as the
executionToken
output parameter on the InvokeVcoWorkflowAsync
activity.
- Specify the same variable name as the
WorkflowExecutionToken
property of the WaitForVcoWorkflowCompletion
activity.
- Retrieve the output of the vRealize Orchestrator workflow.
- Create a variable of type
DynamicOps.VcoModel.Common.VcoWorkflowExecutionResult
.
- Specify the name of the results variable as the
WorkflowOutput
property of the WaitForVcoWorkflowCompletion
activity.
When the workflow runs, the value of the variable is set to the results of the vRealize Orchestrator workflow, if any.