Custom Auth refresh workflow not triggered automatically

Issue:
I have a REST API resource configured with Custom Auth in Retool. Both the initial auth workflow and refresh workflow are set up and work correctly when tested manually via "Test auth workflow" / "Test refresh auth workflow" buttons.

Configuration:

  • Auth workflow: POST to /api/v1/auth/token?type=first_auth → exports BEARER_TOKEN from http1.body.access_token
  • Refresh workflow: POST to /api/v1/auth/token?type=refresh → exports BEARER_TOKEN from http1.body.access_token
  • JWT expires after 1 hour
  • Refresh interval configured to 60 seconds in the resource settings

Problem:
After ~1 hour, my queries fail with 401 Unauthorized ("Invalid authentication token: Signature has expired."). The refresh workflow is never triggered automatically despite:

  • The token being expired
  • The refresh interval being set to 60 seconds

The only way to restore functionality is to manually click "Re-auth" on the resource.
I see no refresh requests in my API logs unless I manually trigger it from the setup page. The 60-second refresh interval does not appear to be respected.

Expected behavior:
Retool should either:

  • Automatically execute the refresh workflow every 60 seconds as configured, OR
  • Automatically execute the refresh workflow when receiving a 401 response, then retry the failed query with the new token

Questions:

  • Is the refresh interval setting actually functional for Custom Auth resources?
  • Is there a way to enable automatic re-authentication on 401 for Custom Auth resources?
  • Or is automatic token refresh only supported for OAuth 2.0?

Hi @ranisterio,

Thanks for reaching out!

When you say the refresh interval is 60 seconds, does this mean that you have the Refresh auth trigger set to time-based expiration with a value of 60 seconds?

This configuration is a proactive solution to refreshing the auth. It should apply at the time of running the query. Its not guaranteed to trigger exactly after expiration time.

Is there a way to enable automatic re-authentication on 401 for Custom Auth resources?

The custom refresh workflow steps should run automatically after any non-200 response when querying a resource Custom API authentication | Retool Docs When the token itself expires, and there is a refresh token available, then refreshing the token is attempted automatically.

What happens if you choose "None" or "Every query run" for the refresh trigger?

It would be helpful to see screenshots of the set up and the Network tab at the ~1 hour mark