repeat http call n times

How do I try n number of times one http call and if it fails after n number of times, then mark that record as failed?
I need to try this http n times in case external site is down
label1: Branch on status codes:
200: mark success
400,404: mark are failed
500: try n times and mark the record failed after n attempts.
After every time, flow needs to be jumped to label1.

Do any body has any small piece of code which does this repeat functionality for http?

Use the repeat statement.

Syntax of said statement having been discussed in detail in the Developer User’s Guide.