abcxyz
1
I need guidance on configuring a workflow to manage API tokens dynamically. Here’s the desired functionality:
- Call the
/login
API with a username and password to retrieve a token.
- Set the retrieved token in credentials for subsequent API calls.
- Before making each API call, check if the token is valid.
- If the token is invalid, call the
/login
API again to obtain a new token and update the credentials.
How can I implement this workflow efficiently in n8n, ensuring the token is refreshed only when needed?
- n8n version: 1.39.1
- Database (default: SQLite): default
- n8n EXECUTIONS_PROCESS setting (default: own, main): default
- Running n8n via (Docker, npm, n8n cloud, desktop app): docker
- Operating system:
n8n
2
It looks like your topic is missing some important information. Could you provide the following if applicable.
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
ria
3
Hi @abcxyz
Thanks for posting here and welcome to the community! 
I’ve made a workflow template demonstrating the $getWorkflowStaticData
function in n8n using the concept of access token validation.
Please have a look if this could be a solution for your use case.
system
Closed
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.