Invalid Template using workflow functions

Logic Apps Update August

This post covers some common pitfalls and hoping to help others saving some valuable time. I recently received a question regarding monitoring Azure Logic Apps and error branching options as covered within this blog post: Azure Logic App – Conditions: Success and Failure.


The question comes down to whatever it’s possible to notify users about failed workflow instances. This is possible; however, where would you like to add the logic?

Monitoring basics – Invalid Template

The first and, in my opinion, recommended solution when it comes to none functional related issues is to have a separate monitoring process hosted within a web job or even better Azure Automation workbook. The Azure Logic App API ( allows you to retrieve Runs for a specific workflow and even allows the usage of filters &filter=status eq ‘Failed’. This approach also enables the usage of complex conditions/logic.

The second option would include the nonfiction logic within the workflow. This option might be interesting if you are expecting certain exceptions that might require inspection by someone with business/process knowledge and not a technical person in particular.

Now in case you would like to create a fallback exception tree, capturing technical issues, it’s important to know that there are some limitations when it comes to retrieving details of the current Run. For example, it’s not possible to retrieve detailed information regarding the current workflow instance within an action at runtime. Simply using the fowling expression within an action results in the following exception.

{"code":"InvalidTemplate","message":"Unable to process template language expressions in action 'http0' inputs at line '1' and column '11': 'The template function 'workflow' is not expected at this location.'."}

Logic app metrics

As mentioned, I’m not a big fan of the second option when it comes to technical issues, and not being able to use the workflow function within actions makes the implementation even more complicated. In the next blog post, I will be covering some solutions on how to build the Logic App monitoring dashboard for support staff, including alerts/notifications.

Post Navigation