What is the best practice to retry synchronous Outbound REST API calls?

sivrajb
Kilo Expert

What is the best practice to retry synchronous Outbound REST API calls? I am aware of the ECC Retry Queue but I believe that is only for aysnc API calls.

Full context:

I am doing the development in a Workflow.

In my workflow for my Servce Catalog/RITM, I have a "Run Script" which will execute the Outbound REST API. However, I want my workflow to retry, say three times, if the API call fails. If it still fails after three retries, my plan is to set Values of the RITM to Canceled, and automatically open an Incident assigned to a Support Team that will investigate and do a manual workaround on the failed API call.

Thanks!

1 ACCEPTED SOLUTION

simonbergstedt
Tera Guru

Managed to solve this? I've done similar things and how to solve it can depend on the target api and how they are reporting back. But One way of doing it is to simply have a variable on the RITM that is being populated with the HTTP-status response you get from the target-API when running the call. That way you can build into the flow to actually check for the value in that variable and if it's ok (200 for example) then you move forward in the workflow, if it not ok then you just to a turnstile and run it again, unless it's the third time it failes which will take on another route in the workflow.

View solution in original post

2 REPLIES 2

simonbergstedt
Tera Guru

Managed to solve this? I've done similar things and how to solve it can depend on the target api and how they are reporting back. But One way of doing it is to simply have a variable on the RITM that is being populated with the HTTP-status response you get from the target-API when running the call. That way you can build into the flow to actually check for the value in that variable and if it's ok (200 for example) then you move forward in the workflow, if it not ok then you just to a turnstile and run it again, unless it's the third time it failes which will take on another route in the workflow.

Hi! The variable idea seems exactly what I'm looking for. I'll be trying it out! Thanks for this!