Share via

Why Logic Apps run history is showing failure, while the message is processed successfully?

Karthik K Koneru 81 Reputation points
2026-03-26T19:33:44.0933333+00:00

I have a Logic apps workflow where a failed event message is written on to DLQ Error queue to re-process later.
Sometimes logic apps RunHistory shows these messages were failed with "BadRequest" Error message with status as "Failed". But actually the message was written successfully on to DLQ. See below screen shots. User's image

User's image

DLQ Message Properties:
User's image

Wanted to understand why it is happening like this.

Azure Logic Apps
Azure Logic Apps

An Azure service that automates the access and use of data across clouds without writing code.


2 answers

Sort by: Most helpful
  1. Pravallika KV 12,730 Reputation points Microsoft External Staff Moderator
    2026-03-26T20:00:18.08+00:00

    Hi @Karthik K Koneru ,

    Thanks for reaching out to Microsoft Q&A.

    The run is marked as “Failed” because one of your connector actions (the manual “Dead-letter the message” step) returned a BadRequest, even though Service Bus did end up moving the message into the DLQ. A run is considered Failed as soon as any action returns a non-2xx HTTP response, regardless of whether the backend state ended up the way you wanted.

    Why this happens in your workflow:

    • Service Bus automatically dead-letters messages once they exceed the max delivery count (the message properties show deadLetterReason = MaxDeliveryCountExceeded).
    • Your Logic Apps step then tries to manually dead-letter that same message by lock token. Because the message’s already gone, the Service Bus connector API returns a 400 BadRequest.
    • Logic Apps flags that connector call as a failure, so the overall run status is Failed—even though the message did end up in the DLQ.

    Steps to resolve it:

    1. Add proper error handling around your dead-letter action. Put it into a Scope or a nested workflow with “Configure run after” so that the BadRequest is caught and treated as a success. For example, use an HTTP Response or a “Terminate” action with status = Succeeded.
    2. Only call manual dead-letter when you’re sure the lock token is still valid. For example, use a delay or check DeliveryCount before you invoke the dead-letter connector.

    Hope this helps!


    If the resolution was helpful, kindly take a moment to click on User's imageand click on Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments

  2. Q&A Assist
    2026-03-26T19:34:03.8833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    In Logic Apps, the overall run status is driven purely by the action statuses in the run history, not by what later happens to the message in Service Bus.

    From the screenshots and the documentation, the behavior is explained as follows:

    1. In the run history, the “Dead‑letter the message in a queue” action shows status Failed with error BadRequest.
    2. According to the run‑history rules, if any action in a run has status Failed and there is no subsequent action configured to handle that failure, the entire workflow run is marked as Failed.
      • For Consumption workflows: “Failed – At least one action in the run failed. No subsequent actions in the workflow were set up to handle the failure.
      • For Standard workflows: the same definition applies to the run status.
    3. Service Bus can still move the message to the DLQ (for example, because MaxDeliveryCount is exceeded) independently of the Logic Apps action result. That is why the message appears in the DLQ with deadLetterReason = MaxDeliveryCountExceeded even though the Logic Apps action reports BadRequest and Failed.
    4. The run history therefore correctly reflects that the Logic Apps action failed, even though the broker (Service Bus) ultimately placed the message in the DLQ for its own reasons.

    To avoid the whole run being marked as Failed when this is an expected condition, configure explicit failure handling on that action (for example, using runAfter conditions, scopes with Succeeded/Failed branches, or try/catch patterns) so that the failure is treated as handled and the run can complete with Succeeded.


    References:

    0 comments No comments

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.