I have an API endpoint to a 3rd party that starts a process on their end. Then I have a 2nd endpoint that calls the status of that original request. I'd like to call that 2nd endpoint, and if the [state] property == 'In progress', then wait a bit, and re-run it. Eventually it will return 'Complete', or 'Approved' or something, and then I can move on down my branch.
I'm using a branch and some code to implement the wait, but I can't connect the wait block back to the previous query because it "creates a cycle". This is actually what I intend, but apparently it's forbidden. What's the best process to do this?
Excellent, thanks! I'll still use the current pattern, as what comes back in the case I mentioned above is not an error, but an 'In Progress' result, but I'm sure this will come in handy in other cases that do return error codes.