27 May 2025 09:47 AM
Hello,
When a workflow task returns Boolean true (or false),
{
"result": true
}
to run the next task if to you need to use:
Who can confirm (-;
KR Henk
Solved! Go to Solution.
27 May 2025 12:13 PM - edited 28 May 2025 08:20 AM
Hi Henk,
That would work, but we always recommend square brackets: {{result("run_javascript_1")["result"] == false}}
Best, Haris
Edit:
It should be `True` or `False` (in capital letters), as these are valid names for Python booleans.
One could also use a "short form", that is:
{{ result("run_javascript_1")["result"] }}
27 May 2025 01:29 PM
It should be `True` or `False` (in capital letters), as these are valid names for Python booleans.
Sorry for nitpicking 🙈
One could also use a "short form", that is:
{{ result("run_javascript_1")["result"] }}
27 May 2025 01:52 PM - edited 27 May 2025 01:56 PM
Hello Michal,
In this case, the combination of TS and Python needs a little nitpicking (-;
So above will work if the result of the task returns True or False, but JS uses true and false. So you need to convert the return first? Or is this done automatic....
Thanks Henk
27 May 2025 02:05 PM
Hi Henk,
If a boolean value needs to be converted, we do that out of the box, so you don't need to worry about that.
Hope this clarifies things a bit 🙂
27 May 2025 12:28 PM
Hi Haris,
Thanks for the comment!
KR Henk
05 Sep 2025 03:31 PM
I see this thread is the most suitable thread for my question and I appreciate if some help in this frustrating workflow.
I have a workflow which I designed to wrap another Dynatrace API to give to another team. The workflow works fine but I am struggling to return only the final results json of the last task in the workflow and I use the following (see also the screen shot)
{{ result("create_token") }}
I add the above in the in the last box of the workflow option (see screenshot)
When I run the workflow from outside using the url of the workflow using the platform API from outside I never get the results of the last task in my workflow instead I only get the output of the workflow content like this,
Any idea what I need to do extra please?
Raw Response Content (bytes): b'{"id":"e2b4522c-8993-4788-88eb-a40bbc697d8f","workflow":"58803a59-3707-4cf0-a080-3d48c9c80194","state":"RUNNING","stateInfo":null,"input":{"name":"cloud_team_remove","days":"30"},"providedInput":{"name":"cloud_team_remove","days":"30"},"params":{},"startedAt":"2025-09-05T14:14:51.535710Z","endedAt":null,"runtime":0,"trigger":"myname@x.com","schedule":null,"eventTrigger":null,"user":"d5ab893c-edde-4351-b63c-7719f537bda9","actor":"d5ab893c-edde-4351-b63c-7719f537bda9","title":"WORKFLOW_NAME","result":{},"triggerType":"Manual","workflowVersion":27,"workflowType":"STANDARD","triggerTypeDetail":{"userId":"d5ab893c-edde-4351-b63c-7719f537bda9"},"parentExecution":null,"parentTaskName":null,"rootExecution":null,"rootWorkflow":"58803a59-3707-4cf0-a080-3d48c9c80194","isDraft":false}'
I was expecting to get only the results of the output of my last task exactly in your case where you want true or false or True or False but my case I need the JSON results of the last task as I mentioned
I appreciate your support.
05 Sep 2025 04:14 PM
I have tried even to use the workflow API to fetch the results in another API call but it returns empty, I used this
Extracted Execution ID: e2b4522c-8993-4788-88eb-a40bbc697d8f Fetching final result from: https://TENANT_ID.dynatrace.com/platform/automation/v1/workflows/executions/e2b4522c-8993-4788-88eb-... === Final Workflow Execution Result === {}
Any more ideas is welcome
06 Sep 2025 09:50 AM
Good Morning Marwan,
I hope I understand the question correctly, otherwise I will remove this answer.
Simply put the workflow runs async. The reply you get says: "state":"RUNNING",
So you have to wait until the WF is done.
So best is: Loop(while running, wait) if done -> get the result.
KR Henk
08 Sep 2025 11:59 AM
Thanks Hank for your reply, there is not a way to wait, as it is a single invokation however, you may fetch the results like you said before in another thread, I am trying this API now