I’d like to automatically refresh API tokens in a data source which only live for 24h using an automation. According to support UI Bakery can’t do that right now.
I’m aware that you can send the token from the automation which actually talks to the data source, but this hits authentication every time I run the automation (very often) - and the cloud is already slow as it is.
Until there’s native support, a common workaround is to split it into two automations. A scheduled one runs every 20 hours or so, fetches a fresh token and writes it, along with its expiry time, to a small table in a database you already have connected. Your frequent automation then just reads that stored token instead of authenticating on every run.
Adding a fallback helps too: if a call comes back 401, refresh once, save the new token and retry. That way an early expiry or a missed schedule doesn’t break anything, and you only hit the auth endpoint about once a day.