Many pro developers will be familiar with the concept of stack traces. Can we take this idea into the low code world?
Stack Trace
Table of Contents
Within Power Automate I like to use child flows and after the introduction of the Try Catch Finally pattern over 5 years ago and the idea of passing Parent flow URLs to child flows, I’ve been thinking about creating a stack trace.

In the pro code world a stack trace can show you which functions/procedures/methods are being called before the current function.
In this post I will take this concept into Power Automate. If you are a fan of child flows and you develop complicated solutions then this post might help you too.
Imagine if I have two flows (Flow 1 and Flow 2), both these flows call a Child flow and these child flows call another child flow. Now my 3rd Child Flow fails every now and then.

It will be useful to find out if Flow 1 started the process or if it was Flow 2 that initiated the chiuld flow.
Building the Parent flows
For simplicity reasons I’m going to implement my flows without the Try Catch pattern. Most likely you will want to use that pattern here as well.
From my parent flow I’m going to call a child flow. Notice that all child flows have an input property called Stack.

In the above Stack property I’m using the following code to include the flow display name and the URL to the flow run. But we could add more fields ( I’m separating the fields with a comma.)
@{workflow().tags.flowDisplayName}, @{concat('https://make.powerautomate.com/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])},
Also notice that there is an empty line and the end of the Stack property.
And then from my child flow I will call another child flow.

In the first level child flow I’m calling the second child flow. Using the Stack input property, I passed in a similar expression to the earlier child flow call. This way I’m building up my stack trace. This time I’m also including a date/time stamp.
@{triggerBody()['text']}@{workflow().tags.flowDisplayName}, @{concat('https://make.powerautomate.com/environments/', workflow()?['tags']['environmentName'], '/flows/', workflow()?['name'], '/runs/', workflow()?['run']['name'])}, @{utcNow()},
And in my 3rd flow I’m repeating this pattern, but this time I’m sending out an email with the failures details including the stack.

And now when we look at the email that was sent, we will find the following stack trace with our flow run details:

Yes of course, we could now look at formatting the stack trace a bit nicer, but that is merely a small bit of detail that is easily implemented.
Hi
Is there any function to list all running instances of a concurrent flow ?
I found a power shell command but not sure how it can be integrated with a power automate flow
I am running concurrent instances of a child flow – when all of them runs I need to update a variable in the parent but not sure how to do it
kind regards
This series of posts will give you the details on how to get the the flow runs using APIs:
https://sharepains.com/2023/03/09/high-volumes-flows-power-automate/