How can I prevent automatic retries for 4xx errors when configuring the Refresh Auth Workflow?

While configuring the Refresh Auth Workflow, I encountered what seems to be a discrepancy between the official documentation and the observed behavior.

The issue I am currently experiencing is that when an error occurs in Retool, if an error occurs when sending an API request in Retool, the server registers two requests, resulting in my user receiving two failure logs.

As per the Retool official documentation, automatic retry upon encountering errors is intended for 401 and 403 status codes. However, in my experience, it appears that automatic retries are being attempted for all types of errors during API requests.

I would appreciate clarification on whether this behavior is intentional or if there might be an issue with my configuration. Additionally, I am interested in understanding if there is a way to selectively disable automatic retries, especially for error scenarios other than 401 and 403.

How can I prevent automatic retries for 4xx errors when configuring the Refresh Auth Workflow?

I understand that your team's time is valuable, and I appreciate any guidance or insights you can provide on this matter. Thank you for your attention, and I look forward to resolving this query to ensure optimal usage of Retool for my project.

Hi @_Bart, welcome to the forum! :wave:
Great question! The Refresh auth workflow will automatically run after any response that is not 200. It running for a 401/403 is just an example on the doc. The reason you are seeing two failure logs may be related to the following events:

  1. The original query is not successful and the server sends back the first error.
  2. The response was not 200, so the workflow runs and succeeds refreshing auth.
  3. The original query is ran one more time, but the error was not related to auth, so the server sends back the same error from event #1.

It would be nice to be able to customize the Refresh auth workflow to only run when the response has a specific error, like 401/403 in your case. I found a feature request for this already! I added your +1 and will let you know when we get any updates. :slightly_smiling_face:

Thank you for being considerate of our time. We are here to help, feel free to ask any questions!