โ02-05-2026 04:01 AM - edited โ02-05-2026 05:14 AM
Hi, when reaching out to an application with the HTTP connector I often get an error for "invalid_token, the access token provided has expired". This seems to happen every time a new token is needed for a call. When repeating the job, the call goes just fine.
First call result:
Second call result:
Does anyone have an idea what the cause could be? Also I never encounter this problem using Postman.
To mee it seems like the token was used too quickly for the target application to be able to validate the token.
In the debug of the HTTP request I see no details of the actual headers/payload/response
What is the best-practice solution I could try?
I have not seen anything like a delay in the HTTP connector settings and it seems to extreme to make a custom connector.
The target application accepts the usual Oauth2 flow, with grant_type: client_credentials.
This results in a bearer token for all following calls.
I look forward to your inspiration, also: please let me know if this is not the right place for this question.
Kind regards,
Vincent
Solved! Go to Solution.
โ02-05-2026 12:05 PM
Hi @vbosma, for the First workaround can you send the response/error of the http action?
How the second workaround, you can create two http invocation if possibile:
โ02-05-2026 05:40 AM
Hi @vbosma, the behavior appears to be due to an internal Workato race condition during automatic OAuth token refresh:
This explains:
As a workaround, you can evaluat:
โ02-05-2026 07:06 AM
Thank you for your quick reply and detailed explanation. The first automatic retry was my first idea too, but then I noticed that the invalid_token response still has a 200 OK status.
So now I put in an IF statement, and then put a WAIT block for 5 seconds, to retry again.. which also has an IF statement to alert if the response is the same.
Do you consider this a proper work-around? The recipe looks like this:
โ02-05-2026 07:24 AM
Hi @francbaviello , I just retried and noticed even this workaround is not proof.. there was still an invalid_token error:
The wait specified length of time is set to 5 seconds, but this does not seem to be enough either.
I might have to check your manual Oauth token management or hope you guys have another way.
โ02-05-2026 10:15 AM
Token expiration is silly, so I choose not to deal with it.
The ๐จ API Police ๐จ probably don't like this, but I always request a new token for every API call.
I split the process into two HTTP actions: one to get the token, then another to make the call with the token.