I've been doing my best to improve and maintain the existing User Event script integration to our delivery routing software for a while, it sends the Sales Order JSON information via API to the software which then creates a delivery task. But I'm running into a bottleneck now of a large number of 429 code responses (too many requests).
I can't put a retry on the current UE API script as it causes record saving to take many seconds.
I need to think on how to rebuild this script and the structure is perhaps the most crucial part.
I was thinking of having a User Event script that triggers a MR script.
This MR will build the payload and create a Queue Record that contains the JSON payload, SO ID, Number of Attempts Integer, Queue Status (Pending, Complete, Failed) and the date.
I then have a Scheduled Script (or should this also be MR?) trigger every min to search for all the queued records and trigger the get, put and post http requests for each record. If it fails, it will add it back into the queue and mark the number of times it's attempted to send the request.
Does this UE → MR → Queue Record → SS Processor structure sound correct?