I am receiving a webhook event from a external web service, once arrived, I have to make a new HTTP request for obtain more info, for doing that, I have to request a Auth Token that can be used for the request.
The token is available for 30 minutes, but so far I am using a new token for each new request/webhook event.
I would like to find a way to use the same token for all the request within the 30 minutes of validity.
Have you ever had a similar use case? My first idea is to use an external db as Gsheet, but need to understand how to manage the 30 minutes time.
According to the OAuth 2.0 standard, you should not rely on the token lifetime. Instead, your workflow should handle the 401 Error itself (if it occurs >> request new token).
As to the sharing, you can save it locally in a file or in the WorkflowStaticData (if it will be reused in the same workflow).
UPDATE:
I’ve found a way to create a file in the Disk and then Read it using the Command Line:
This one is the example:
So basically the process should be:
Read the token already saved on the disk, use it for the HTTP request, then check if there is an error,
If yes: I will generate new token, save it in the disk in the same file, and run the request again,
If no: Continue the process