Run history workflow timing values questionable

Christopher Fryett 125 Reputation points
2025-09-08T05:10:36.75+00:00

I have the following high-level scenario:

Main workflow

  1. Trigger occurs and variables initialized
  2. do-while loop boolean - break on true
    1. check if loop variable = false, if false - continue
    2. sql connector - get row
    3. if get row returns 404 call another workflow for deeper search
      1. in workflow calls another workflow for authentication tokens
        1. calls 2 function apps for different types of tokens (to complex for logic apps), returns token
      2. in workflow use http connector - issues call to 3rd party api with tokens
      3. return response from http
    4. if workflow returns 404, insert info to db and set loop break to true
  3. return results

Happy path there would only be 1 iteration hitting 'b' and onward.

When I look at the run history and the times each action takes it does not reflect the actual times in the subflows. This gives some misleading or skewed timings on how long a primary/main flow actually runs, or is the timings accurate and each call to a subflow could take 2 or more seconds? For example, the main flow says it takes 6 second for 'c' to complete but when looking at that run history it shows it took 4.3 s. And that flow calls 'i' and says it completed in 2s but the calling flow 'ii' took 0.8s. Overall, the mainflow takes 10s to complete whereas if I wrote a C# app it likely will be a fraction of that. The get and insert rows are fast in the main flow. Hopefully I didn't make this confusing.

In order to reduce making workflows large I have broken them down for reuse and also readability per se.

I am running logic apps and function apps under the app service plan IVI2.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
0 comments No comments
{count} votes

Answer accepted by question author
  1. Alex Burlachenko 18,310 Reputation points Volunteer Moderator
    2025-09-09T09:56:39.7266667+00:00

    the thing is, the timings you see in the logic app run history include overhead that you wouldn't have in a pure c# app. every time you call a nested workflow or a function app, there's a bit of orchestration latency. azure has to spin up the action, validate permissions, and handle the communication between services. that can easily add a second or two per call.

    so when your main flow shows 6 seconds for step 'c', but the sub-flow itself only took 4.3 seconds, that extra 1.7 seconds is likely the overhead of starting and stopping that child workflow. same thing with your function apps. the http connector itself might report 0.8 seconds, but the function app's cold start time and execution time are bundled into that.

    this might help in other scenarios too, always expect some overhead with distributed systems.

    if you want to get a more accurate picture, add some logging at the very start and very end of your function apps. log the exact datetime when the function begins and ends. compare that to the timings in the logic app. you'll probably see that the function itself is fast, but the trigger and response steps add time.

    also, check the scale settings on your app service plan. if you're on a lower tier, cold starts can be more pronounced. moving to a premium plan might shave off some time, but it won't eliminate the orchestration overhead completely.

    unfortunately, that's just the nature of a low code platform like logic apps. you trade off raw performance for development speed and ease of use. for most business processes, a 10 second total run time is acceptable, but if you need millisecond performance, a custom c# app running on a dedicated app service would be the way to go.

    hope this clarifies things. those timings are probably "accurate" from azure's perspective, even if they include overhead you wouldn't expect. let me know if you want to dive deeper into optimizing specific steps.

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.