Microsoft oauth nodes repeatedly fail maintain connection

Describe the problem/error/question

Our microsoft business oauth modules seem to repeatedly fail to get refresh tokens after a certain amount time. This is usually after about 1-2hrs although after a full workplace restart can sometimes be ok for 3-48hr

This happens even though the oauth is set to offline (scopes are: Calendars.Read Calendars.Read.Shared Calendars.ReadBasic Calendars.ReadWrite Calendars.ReadWrite.Shared Contacts.Read Contacts.Read.Shared Contacts.ReadWrite Contacts.ReadWrite.Shared email Mail.Read Mail.Read.Shared Mail.ReadBasic Mail.ReadBasic.Shared Mail.ReadWrite Mail.ReadWrite.Shared Mail.Send Mail.Send.Shared MailboxFolder.Read MailboxFolder.ReadWrite MailboxItem.Read MailboxSettings.Read MailboxSettings.ReadWrite offline_access openid profile User.Read)

The error comes through as a dummy.stack.replace is not a function error. Although this certainly seems to be an oauth issue. The issue did not use to exist, and seemed to be introduced for us at least on the 20th of Feb, so i believe a N8N release caused the problem.

The result of this bug is that our outlook related flows consistently fail and requires constant monitoring as only reconnecting the microsoft outlook oauth or restarting the workspace can resolve the issue.

I have even gone so far as to switch the oauth method from the built in n8n one to using my own custom azure Microsoft oauth app and the the issue is still persisting.

Please share your workflow

Share the output returned by the last node

Problem in node ‘Get a message‘
dummy.stack.replace is not a function

Information on your n8n setup

  • n8n version: [email protected] (although the bug has been present in the last 4-5 versions since mid-feb)
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): cloud
  • Operating system: NA
1 Like

I should also note that this error occured with the native/built in outlook connector node AND also with the custom http node going direct to Microsoft graph api

1 Like

Hey @Jake_Wauchope

I saw you opened an issue in GitHub, that’s actually the one to watch for a fix. It is indeed a confirmed n8n bug…

For now the only workarounds are reconnecting the credential or restarting the workspace, which you already know. Since this is on n8n Cloud, email [email protected] and reference both #23182 and #26453, they closed #23182 without a real fix so pushing through support with your Cloud account is the fastest way to get eyes on it.

Hope it will get fixed soon :crossed_fingers:

That dummy.stack.replace error is actually n8n’s error serialization crashing on top of the real OAuth failure, it’s masking what’s actually going wrong underneath. The root cause is tracked in GitHub #25926 where n8n fails to properly persist the new refresh token after Microsoft rotates it, so once your access token expires (~1 hour) it can’t obtain a new one and everything breaks. That’s exactly why switching to your own Azure app didn’t fix it — it’s not just about the managed app’s client secret, it’s n8n’s own token storage logic. I’d email help.io and specifically reference #25926 alongside #26453 since that first one is the actual underlying cause.