CodexBloom - Programming Q&A Platform

Azure Logic Apps - How to handle multiple failures with retries and notifications in a workflow?

πŸ‘€ Views: 1817 πŸ’¬ Answers: 1 πŸ“… Created: 2025-07-02
azure logic-apps error-handling api json

I'm relatively new to this, so bear with me. I'm sure I'm missing something obvious here, but I'm working on an Azure Logic App that orchestrates a series of API calls to various services... Recently, I've encountered issues where one of the HTTP actions fails sporadically due to timeouts, which causes the entire workflow to unexpected result. I want to implement a robust behavior handling mechanism that retries the failed action a few times before sending an email notification to the team. I've set up the workflow with a simple HTTP action as follows: ```json { "type": "Http", "inputs": { "method": "GET", "uri": "https://example.com/api/data" } } ``` However, I'm not sure how to configure the retry policy. The Logic App designer allows me to set 'Retry Count' and 'Retry Interval', but I've noticed that when I set these values, they don't seem to work as expected. For example, I set the retry count to 3, but if the HTTP action fails, it just sends the notification immediately without any retries. Additionally, I want to customize the email notification based on the behavior details. For instance, if the behavior is due to a 404 status, the message should indicate that the resource was not found. Here’s the code I attempted to use for the notification action: ```json { "type": "SendEmail", "inputs": { "to": "team@example.com", "subject": "Workflow behavior Notification", "body": "An behavior occurred: @{triggerOutputs()['headers']['x-ms-client-request-id']}" } } ``` I’d appreciate any guidance on how to effectively implement retries in Azure Logic Apps and customize behavior notifications based on the type of failure encountered. Are there any best practices for structuring the behavior handling in Logic Apps that I may be overlooking? I’m currently using Azure Logic Apps Standard with the latest version available as of October 2023. For context: I'm using Json on Linux. Is there a better approach? I'm working on a service that needs to handle this. Any help would be greatly appreciated! Has anyone else encountered this? I'm coming from a different tech stack and learning Json.