Showing results for 
Search instead for 
Did you mean: 
Not applicable

HTTP 404 Error Handling: Apply To Each


I've seen a few other posts on this, but none seem to resolve my issue here. I'm looping through all users in an organization and calling their "manager" endpoint in Microsoft Graph. I understand that I'll get 404s when they don't have a manager, and so I set up what I expected to be the correct way to handle these.


I configured two "Run After" steps; one for "Has Failed" and one for "Successful". The "Has Failed" simply increments a counter; I don't need to necessarily do anything after the failure. The Success writes to an array, that will eventually get written to a file. I'm writing two files at the end, so I do have subsequent steps after the Apply To Each.


Do I have to have a step after the increment variable on the fail condition for it to continue?



Not applicable

For clarification, here are my "Run After" configurations:



Hi, were you able to resolve this issue? I am trying to do something similar. TRying to read a row from excel to see if it exists or not and do certain actions in both cases. But on "has failed" action works but the flow is marked failed. Is there a way to fix this?


Frequent Visitor

I'm having the exact same problem except I tried to initialize and set a variable to check if it was null, but it still won't proceed once it gets that 404 manager not found error


Apply to each will not proceed to the next action if the previous action failed.

If you want to keep going after a failure is encountered, you can simply insert the Apply to Each action within Do Until. Please refer below steps 

  1. I simply initialized an Integer variable with value 1
    1. NiloferA_4-1619176504308.png
  2. Add a Do Until Action, with following condition (The condition will always be true so the Apply to Each loop will go on even if any iteration fails)
  3. Add Apply to each action within Do Until 
    1. NiloferA_5-1619176589494.png
  4. See it in working here
    1. NiloferA_6-1619176638473.png

Hope this helps! Please post your questions if any.

Frequent Visitor

What if I'm not doing a loop and there will only be one record at a time?

Well then it's even simpler. You just need two branches, One for when the previous action is Successful and the other when the previous action has Failed.

In this case, when there is a failure, the actions in the Failed Branch will execute but the Status of the Flow will show as Failed because there was indeed a failure.

To avoid confusion here, at the end of the Failed Branch, you can add a Terminate action and set the Status to either "Successful" or "Cancelled".


Frequent Visitor

Terminate! that's what was missing. thanks so much.

Not a problem! 🙂 Please mark the response as a solution if you found it helpful.

Helper I
Helper I

Is there a solution for this if the HTTP request is inside an apply to each control? Cant use the terminate action in this case.

New Member

My flow is almost exactly like this except that instead of the HTTP3 request, I have a get item SharePoint action. I understand that it will not work in some cases so I set up my flow to send a Teams message and then terminate the flow.


However, when the get item fails, the "post message in chat or channel" does not run and the terminate action is skipped even after I configured the run after to only when the SharePoint get item action fails. 


I have attached a picture of the flow below. 



Helpful resources

Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (1,555)