How can I poll a request in Postman until a task reaches "Successful" or "Failed" status?

A while back I shared a method using the Collection Runner that might be adapted here, it was a different context and a few years ago so it’s not going to be a straight copy and paste solution.