Example 8: Two Step Workflow: Execute and Validate REST Calls

In this V2.0 syntax example we demonstrate passing information from one step to another step. This example is also a multistep workflow sample.

{ "name": "Test the provisioning REST workflow",
  "version": "1.0",
  "workflow": {
    "name": "Two step provisioning REST workflow",
    "version": "1.0",
    "plan": {
      "steps": [
        {
          "name": "provision",           
          "operation": {
            "type": "REST",
            "parameters": {
              "method": "GET",
              "uri": "${workflow.vars.REST_URL}"
            }
          },  
          "publish": {
            "uri": "${step.operation.result.http_body}"
          }
        },
 
        {
          "name": "validate",
          "operation": {
            "type": "REST",
            "parameters": {
              "method": "GET",               
              "uri": "${steps.provision.result.uri}"
            }
          }
        }
      ],       
      "publish": {
        "result": "done"
      }
    },
 
 
    "input": {
      "vars": {
        "REST_URL": "http://host01.example.com/provision/compute",
      },
    }
  }
}