Invalid Template using workflow functions

Logic Apps Update August

Just a short post covering some pitfalls and hoping to helping others to save some valuable time. I recently received a question regarding monitoring Azure Logic Apps and error branching options as covered within this blogpost: Azure Logic App – Conditions: Success and Failure.

The question basically comes down to whatever it’s possible to notify users about failed workflow instances. Which is absolutely possible however the interesting part here is 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 details 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 complex. In the next blog post I will be covering some solution on how build Logic App monitoring dashboard for support staff including alerts / notifications.

Post Navigation