Hello all. As I am new to Stackstorm (v.3.2) and working to create workflows in orquesta, I’m struggling figure out how to debug and get values dynamically passed from one task to another. I’ve read through the documentation and looked through many of the examples; however, I’m not finding the right information to help me pass a particular JSON value that is received from the second task “GetTenantGroup”, into a variable (tgroupid), that is to be used in a third task “CreateTenant”
input:
- customername
- customerslug
vars:
- tgroupid: 0
tasks:
CreateTenantGroup:
action: netbox.post.tenancy.tenant_groups name=<% ctx(customername) %>, slug=<% ctx(customerslug) %>
next:
- when: <% succeeded() %>
do: GetTenantGroup
GetTenantGroup:
action: netbox.get.tenancy.tenant_groups name=<% ctx(customername) %>
next:
- when: <% succeeded() %>
publish:
- tgroupid : <% result().result.raw.results.id %>
do: CreateTenant
CreateTenant:
action: netbox.post.tenancy.tenants name=<% ctx(customername) %>, slug=<% ctx(customerslug) %>, group=<% tgroupid %>
next:
- when: <% succeeded() %>
Running the action ‘netbox.get.tenancy.tenant_groups’ by itself via the UI, returns the following JSON output as a result:
{
"stdout": "",
"stderr": "",
"exit_code": 0,
"result": {
"raw": {
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 3,
"name": "Some Company",
"slug": "some-company",
"parent": null,
"description": "This is Some Company",
"tenant_count": 1
}
]
}
}
}
As you can see from the JSON output above, it returns the {“id”: 3} value that I’m trying to get assigned to the (tgroupid) variable that I have defined. Can someone please assist?
Also, I would like to understand how I can print the value of the variables at different places throughout a workflow to understand if/when they are changing. Similar to what you can do in any python script by printing the value at any point in a script.