fix(ClickUp Node): Unclear error message when using OAuth credentials#28584
Conversation
There was a problem hiding this comment.
No issues found across 4 files
Architecture diagram
sequenceDiagram
participant Node as ClickUp Node
participant Core as Core (requestOAuth2)
participant Auth as OAuth2 Token Handler
participant API as ClickUp API
Note over Node, API: OAuth Request Flow with skipTokenRefresh
Node->>Core: requestOAuth2()
Note right of Node: NEW: sets skipTokenRefresh: true
Core->>API: HTTP Request (with Access Token)
alt API Success
API-->>Core: 200 OK
Core-->>Node: Return Data
else API Returns 401 (Expired or Invalid Resource ID)
API-->>Core: 401 Unauthorized / { "ECODE": "OAUTH_023" }
Note over Core: CHANGED: Check skipTokenRefresh flag
alt skipTokenRefresh is true (NEW Behavior)
Core-->>Node: Bubble up original 401 Error
Note over Node: Node displays clear ClickUp error message
else skipTokenRefresh is false (Standard Behavior)
Core->>Auth: retryWithNewToken()
Auth->>Auth: Check for refresh_token
alt refresh_token missing (ClickUp Case)
Auth-->>Core: Throw "No refresh token" (Cryptic Error)
Core-->>Node: Error: Refresh failed
else refresh_token exists
Auth->>API: Refresh Access Token
API-->>Auth: New Access Token
Auth->>API: Retry original request
API-->>Core: 200 OK
end
end
end
Bundle ReportChanges will increase total bundle size by 8.09kB (0.02%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: editor-ui-esmAssets Changed:
|
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Performance ComparisonComparing current → latest master → 14-day baseline
docker-stats
Memory consumption baseline with starter plan resources
Idle baseline with Instance AI module loaded
How to read this table
|
…consistently-returns-errors
Co-authored-by: Dawid Myslak <dawid.myslak@gmail.com>
|
@DawidMyslak GH dismissed your approval after I applied your suggestion 😅 Not the best UX, can you reapprove please? |
|
Got released with |
Summary
ClickUp doesn't support token refresh for OAuth access token, so it does not return the refresh token when authorizing and the access token has no expiry (docs). Besides that, if a user tries to access a resource (task, list, etc) by ID and it's not a valid ID, ClickUp's API returns a 401 with
{ "err": "Team(s) not authorized", "ECODE": "OAUTH_023" }. n8n by default would try to initiate a token refresh, but will throw an error because the refresh token is missing here. This PR fixes it by adding a flag to disable token refresh on 401. This way, the behavior and errors are consistent between using OAuth and Access TokenVideo of behavior before the fix:
2026-04-16.18-51-27.mp4
Video of behavior after the fix:
2026-04-16.18-54-17.mp4
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/NODE-4545/community-issue-clickup-trigger-consistently-returns-errors-and-is
Closes #14277
Review / Merge checklist
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)