How to handle Errors in Logic Apps

clouddataquest 91 Reputation points
2023-01-18T12:43:28.8133333+00:00

Hello, i got this logic app which moves files to an SFTP Server, to an Archiv Folder and at the end it deletes the files from the root folder. My Question is how to error handle this, because if the job fails at sftp or archiv, it never deletes the files from the root folder and it would move the same files again the next run. I hope you got some ideas for me. Thank you very much! Regards
User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

3 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-01-19T09:13:24+00:00

    @clouddataquest Thanks for reaching out. You need to set the run after behavior on your action. For more details you can refer to this section. For more details on how to handle errors and exceptions you can refer to this document.

    You can refer to the steps here on how you can set the configure the run after behavior on any action so your next action runs based on the configuration (default: is successful, has time out, is skipped, has failed) you have specified.

    Feel free to get back to me if you have any queries or concerns.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

  2. Deepthi Murali 21 Reputation points
    2023-01-19T13:48:05.82+00:00

    Hi,

    You need to set the run after settings in the Delete step to handle both success and failure of Archive Step.

    So click on the three dots (...) in action 'Delete file Base Order' Action and set the run after setting as below :

    User's image

    0 comments No comments

  3. Vamshi Vadikari 21 Reputation points
    2023-01-20T06:34:00.5833333+00:00

    @clouddataquest .

    There are 2 ways to handle exceptions

    1.Please use run after behavior on your action.

    2.Use Scope Action such that the Exceptions can be handled. You can group actions together inside a scope. You can use scopes when you want to logically group actions together, assess the scope's aggregate status, and perform actions based on that status. After all the actions in a scope finish running, the scope itself gets its own status.

    To check a scope's status, you can use the same criteria that you use to check a workflow run status, such as Succeeded, Failed, and so on. Please Refer the below link for reference.

    Handle errors and exceptions in Azure Logic Apps

    Please 'Accept as answer' and ‘Upvote’ if you like the answer.

    0 comments No comments

Your answer

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