How does the OAuth2 credentials generate tokens?

Describe the issue/error/question

I have a question according the working of credentials in N8N. In my workflow I have 6000 records that I want to send to Zoho Creator using the API but there is a limit on generating access tokens.

I am splitting the data in batches of 200 items and send it to a sub workflow where I map the 200 items into 1 item (array with 200 objects). This is sent to Zoho Creator. It will be executed around 30 times.

Does this mean there are 30 different access tokens generated? Or is there only one token generated every hour?

And how does this work if you execute an HTTP request when having multiple items (one HTTP request per item)? Is there only one access token generated then or is there also an access token generated for each item?

What is the error message (if any)?

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version:
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:
1 Like

Really great question. I know in speaking to @RicardoE105 the generic Oauth2 credentials should cache the access token they receive. However I’m not sure if the mechanism caches across executions of a node, or for each item requested. In your case, and probably most cases, you’d want the cached value to be retrieved/used as soon as the first one is generated.

@Marciano_Antonacci I’m assuming you are using OAuth2. The access token is generated when you connect you account using OAuth2, then once the access token expires (usually every hour), it’s refreshed automatically for you. So to answer your question it will exist only one access token per hour (assuming that Zoho Creator expires the access token every hour)