How could I cache a token between 5 minutes in the n8n custom node?
Since our target service need this token when do request it, and it will expire in 5 minutes,
then we have to recreate one.
Is there any way to keep this token? and renew it at the correct time?
We implement this logic with Redis in Django cache with Python.
But I don’t know how to do it in n8n, since I’m pretty new in TypeScript.
I’m working with a custom Node that needs special auth steps:
- generate a token locally from a function.
- attach token as a parameter when making a request.
For example, you will get a token
aeqwerfas234qwer by calling the generate_token function.
then you can make a request with https://my-gllue.com/rest/clients/?private_token= aeqwerfas234qwer
We can use this token within 5 minutes, then we have to renew it.