Orquesta Task Execution Id: how do I get the build_veb task id? build_veb_id: <% task(build_veb).task_execution_id %> not getting me the correct task, nor is build_veb_id2: <% ctx().st2.action_execution_id %>, giving me the parent action-id

Looking for a way to detect the task id of a particular task that is currently within an orquesta series, ignore the iterate_vebs if this is not significant, it calls the *series that is just a list of tasks to resolve

(
iterate_vebs:
with:
items: <% ctx(vebs) %>
concurrency: 1
#action: examples.echo message=<% item() %>
action: examples.orquesta-bios-denverton40-series veb_next=<% item() %> parent_execution_id=<% ctx().myId %>
)

… examples.orquesta-bios-denverton40-series.yaml

tasks:
fetch_BuildNumber:
action: core.http url="<% ctx().myUrl %>?branch=<% ctx().target %>&packageName=<% ctx().veb_next %>" verify_ssl_cert=False timeout=<% ctx().timeout %>
next:
- when: <% succeeded() %>
publish:
- buildNumber: <% result().body %>
#do: report_results_true
do: build_veb
- when: <% failed() %>
#do: report_results_false
do: build_veb

  **build_veb**:
    action: core.windows_cmd cmd="<% ctx().myBuildCmd %><% ctx().myTarget %>.bat <% ctx().veb_next %> <% ctx().buildNumber %>" host=<% ctx().server_url %> username=<% ctx().username %> password=<% ctx().password %> timeout=<% ctx().timeout %>
    next:
      - when: <% succeeded() %>
        publish:
          - build_veb_output: <% result().stdout %>
          - build_veb_id: <% task(build_veb).task_execution_id %>
          - build_veb_id2: <% ctx().st2.action_execution_id %>
        do: 
          - report_results_true
      - when: <% failed() %>
        publish:
          - build_veb_output: <% result().stdout %>
          - build_veb_id: <% task(build_veb).task_execution_id %>
          - build_veb_id2: <% ctx().st2.action_execution_id %>
        do: 
          - report_results_false

Thanks in advance,

Peter M. Gits

There are two identifier for a task. The task_id which is essential the task name from the WF definition except for some specific use case where it is appended with an index. The task_execution_id which is to identify the execution of the task in StackStorm and it’s in the format of UUID. I’m not sure from your example and question what ID you want. But you can get both from the task() function. For more information what other data is returned in the task() function, you can review the return statement for the function at st2/runtime.py at master · StackStorm/st2 · GitHub.

Thanks I will try both. Just to clarify I am trying to get the execution Id of the build_veb_1 task as seen in this screen shot below. Ideally I need to come back with 5d2e424cd09ab760b8f382bc but what I currently get is iterate_vebs_1 5d2e4248d09ab760b8f382b6

In that case, there’s also additional context information with ctx().st2, specifically ctx().st2.action_execution_id.