Hubspot Trigger has no Refresh Token, token expires

Describe the problem/error/question

My Hubspot trigger works fine after initial setup. Then after some time, the Oauth token expires and the API requests give error 401 - {“status”:“error”,“message”:“The OAuth token used to make this call expired 4 minute(s) ago.”,“correlationId”:“cbbab0c6-7ca2-4866-8a90-f4c19cfc3a97”,“category”:“EXPIRED_AUTHENTICATION”,“context”:{“expire time”:[“2025-04-17T09:19:07.713Z”]}}
→ How do I make the trigger auto-refresh the token?

What is the error message (if any)?

nothin in N8n, for Hubspot error see above

Please share your workflow

(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

Share the output returned by the last node

Information on your n8n setup

  • **n8n version:**1.86.0
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • **Running n8n via (Docker, npm, n8n cloud, desktop app):**n8n cloud
  • Operating system:

Have you included offline scope in your hubspot account. HubSpot only issues refresh tokens if you include the offline scope when authenticating. The documentation is a bit vague but I think that could be the issue. HubSpot Developer Documentation " If you need offline access to HubSpot data, store the refresh token you get when initiating your OAuth integration and use it to generate a new access token once the initial one expires."

Thanks for your reply!

I cannot include offline in the scope when developing the app (with webhook) in Hubspot, so the only way to include it would be to use a custom OAuth for Hubspot with offline in the auth_uri_query_params, but sadly this does not work for me.

So basically, the Hubspot trigger works fine for 30mins, then the token expires and does not refresh. I can get a new access token using my refresh_token, but I would need to perform a refresh of my token every 30 mins, I feel that this makes no sense when working with a change event trigger.