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.

Before you begin

Call a vRealize Orchestrator Workflow using the InvokeVcoWorkflowAsync 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

  1. In vRealize Automation Designer, open a workflow where you have used the InvokeVcoWorkflowAsync activity.
  2. Navigate to the context where you want to retrieve the results of the vRealize Orchestrator workflow.
  3. Drag the WaitForVcoWorkflowCompletion activity into the Designer pane.
  4. 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.

  5. Create a variable of type DynamicOps.VcoModel.Common.VcoWorkflowExecutionToken.
  6. Create a variable of type DynamicOps.VcoModel.Common.VcoWorkflowExecutionToken.
  7. Specify the name of the token variable as the executionToken output parameter on the InvokeVcoWorkflowAsync activity.
  8. Specify the same variable name as the WorkflowExecutionToken property of the WaitForVcoWorkflowCompletion activity.
  9. Retrieve the output of the vRealize Orchestrator workflow.
    1. Create a variable of type DynamicOps.VcoModel.Common.VcoWorkflowExecutionResult.
    2. 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.