To be able to provide the right format in the executionContext to trigger Workflow externally via Swagger API using Workflow ID
Error 400 Bad request when trying to run a workflow via API because of the JSON format in the executionContext field.
In order to create the executionContext payload follow the next steps.
Log in to VMware Aria Automation Orchestrator.
Run the desired workflow in the UI. Capture from the UI the following information:
- executionId
- workflowId
As an example, this is the executionContext for the workflow Clone, Windows with single NIC on a lab environment:
{
"parameters":[
{
"value":{
"sdk-object":{
"type":"VC:VmFolder",
"href":"https://vrafqdn:443/vco/api/catalog/VC/VmFolder/vrafqdn%252Cid%253Agroup-v4/",
"id":"vrafqdn,id:group-v4"
}
},
"type":"VC:VmFolder",
"name":"folder",
"scope":"local"
},
{
"value":{
"string":{
"value":"Name of VM after cloning"
}
},
"type":"string",
"name":"name",
"scope":"local"
},
{
"value":{
"sdk-object":{
"type":"VC:VirtualMachine",
"href":"https://vrafqdn:443/vco/api/catalog/VC/VirtualMachine/vrafqdn%252Cid%253Avm-13387/",
"id":"vrafqdn,id:vm-13387"
}
},
"type":"VC:VirtualMachine",
"name":"vm",
"scope":"local"
},
{
"value":{
"boolean":{
"value":false
}
},
"type":"boolean",
"name":"powerOn",
"scope":"local"
},
{
"value":{
"boolean":{
"value":false
}
},
"type":"boolean",
"name":"template",
"scope":"local"
},
{
"type":"VC:Datastore",
"name":"datastore",
"scope":"local"
},
{
"type":"VC:HostSystem",
"name":"host",
"scope":"local"
},
{
"type":"VC:ResourcePool",
"name":"pool",
"scope":"local"
},
{
"value":{
"boolean":{
"value":true
}
},
"type":"boolean",
"name":"doSysprep",
"scope":"local"
},
{
"value":{
"string":{
"value":"test"
}
},
"type":"string",
"name":"clientName",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"productId",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"joinDomain",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"joinWorkgroup",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"domainAdmin",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"domainAdminPassword",
"scope":"local"
},
{
"value":{
"sdk-object":{
"type":"VC:CustomizationLicenseDataMode",
"href":"https://vrafqdn:443/vco/api/catalog/VC/CustomizationLicenseDataMode/perSeat/",
"id":"perSeat"
}
},
"type":"VC:CustomizationLicenseDataMode",
"name":"licenseMode",
"scope":"local"
},
{
"value":{
"number":{
"value":5
}
},
"type":"number",
"name":"licenseUsers",
"scope":"local"
},
{
"value":{
"string":{
"value":"Password!"
}
},
"type":"string",
"name":"newAdminPassword",
"scope":"local"
},
{
"value":{
"sdk-object":{
"type":"Enums:MSTimeZone",
"href":"https://vrafqdn:443/vco/api/catalog/Enums/MSTimeZone/130/",
"id":"130"
}
},
"type":"Enums:MSTimeZone",
"name":"inTimezone",
"scope":"local"
},
{
"value":{
"sdk-object":{
"type":"VC:Network",
"href":"https://vrafqdn:443/vco/api/catalog/VC/Network/vrafqdn%252Cid%253Advportgroup-6012/",
"id":"vrafqdn,id:dvportgroup-6012"
}
},
"type":"VC:Network",
"name":"network",
"scope":"local"
},
{
"value":{
"array":{
"elements":[
]
}
},
"type":"Array/string",
"name":"dnsServerList",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"dnsDomain",
"scope":"local"
},
{
"value":{
"boolean":{
"value":true
}
},
"type":"boolean",
"name":"dhcp",
"scope":"local"
},
{
"value":{
"array":{
"elements":[
]
}
},
"type":"Array/string",
"name":"gateway",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"ipAddress",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"macAddress",
"scope":"local"
},
{
"type":"VC:CustomizationNetBIOSMode",
"name":"netBIOS",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"primaryWINS",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"secondaryWINS",
"scope":"local"
},
{
"value":{
"string":{
"value":""
}
},
"type":"string",
"name":"subnetMask",
"scope":"local"
},
{
"value":{
"string":{
"value":"test"
}
},
"type":"string",
"name":"orgName",
"scope":"local"
},
{
"value":{
"string":{
"value":"testuser"
}
},
"type":"string",
"name":"fullName",
"scope":"local"
}]}