Question

ThrottledError retries with non-idempotent API operation

  • 16 October 2023
  • 0 replies
  • 14 views

Hi,

I have built a custom integration to talk to our HRIS. The action adjusts the leave balance for an employee for a number of leave types.

The custom action acts on a single employee and POSTs a number of adjustments to the API. Typically a task will make adjustments for 2-3 leave types per employee. The API adds/subtracts a value from the employee’s leave balance and is non-idempotent.

During testing we encountered a number of HTTP 429 errors when we exceed the API rate limit and observed the action being retried after 60 seconds. During test verification we discovered a number duplicate adjustments being applied to the employee’s leave balance.

Further investigation into the issue uncovered that the employee had three adjustments and the first two adjustments succeeded but the third failed with a 429 error. After a retry the three adjustments were applied successfully, however the first two adjustments were applied twice.

The documentation isn’t very clear what happens after a ThrottledError is thrown. However, I based on our observations Zapier appears to re-runs the entire action with the same data inputs, rather than replaying the requests that failed with a 429 response. 

Ideally the HRIS API would ignore duplicate requests but the vendor is unable to make the necessary changes.

In our use case, it would be ideal to re-run the entire Zap, rather than the action, but this does not appear to be supported.

Given the client is responsible for preventing duplicate requests, is there a way to fine tune the retry behaviour to suit our use case?

 

 

 


0 replies

Be the first to reply!

Reply