Skip to content

fix(ClickUp Node): Unclear error message when using OAuth credentials#28584

Merged
RomanDavydchuk merged 5 commits intomasterfrom
node-4545-community-issue-clickup-trigger-consistently-returns-errors
Apr 20, 2026
Merged

fix(ClickUp Node): Unclear error message when using OAuth credentials#28584
RomanDavydchuk merged 5 commits intomasterfrom
node-4545-community-issue-clickup-trigger-consistently-returns-errors

Conversation

@RomanDavydchuk
Copy link
Copy Markdown
Contributor

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 Token

Video 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

  • I have seen this code, I have run this code, and I take responsibility for this code.
  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with Backport to Beta, Backport to Stable, or Backport to v1 (if the PR is an urgent fix that needs to be backported)

@RomanDavydchuk RomanDavydchuk marked this pull request as ready for review April 16, 2026 16:10
@Joffcom Joffcom requested a review from DawidMyslak April 16, 2026 16:12
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Bundle Report

Changes will increase total bundle size by 8.09kB (0.02%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
editor-ui-esm 45.77MB 8.09kB (0.02%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/worker-*.js -3.15MB 17.9kB -99.43%
assets/worker-*.js 3.15MB 3.17MB 17586.03% ⚠️
assets/constants-*.js -210 bytes 3.14MB -0.01%
assets/index-*.js 1.79kB 1.31MB 0.14%
assets/ParameterInputList-*.js -8 bytes 1.27MB -0.0%
assets/users.store-*.js 4.87kB 1.06MB 0.46%
assets/core-*.js 226 bytes 628.18kB 0.04%
assets/InstanceAiView-*.js 3.72kB 349.3kB 1.08%
assets/ParameterInputList-*.css 35 bytes 208.27kB 0.02%
assets/InstanceAiView-*.css 3 bytes 166.79kB 0.0%
assets/WorkflowLayout-*.js -36 bytes 127.92kB -0.03%
assets/router-*.js 502 bytes 119.81kB 0.42%
assets/NodeSettings-*.js 82 bytes 84.68kB 0.1%
assets/CreditWarningBanner-*.js -285 bytes 54.89kB -0.52%
assets/SettingsInstanceAiView-*.js 1.83kB 46.46kB 4.11%
assets/InstanceAiOptinModal-*.js 18 bytes 24.75kB 0.07%
assets/SettingsInstanceAiView-*.css 155 bytes 23.88kB 0.65%
assets/useCustomAgent-*.js -36 bytes 20.76kB -0.17%
assets/instanceAiSettings.store-*.js 738 bytes 15.73kB 4.92%
assets/WorkflowPreview-*.js 40 bytes 7.96kB 0.5%
assets/dist-*.js (Deleted) -5.34kB 0 bytes -100.0% 🗑️

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 16, 2026

Merging this PR will not alter performance

✅ 32 untouched benchmarks
⏩ 20 skipped benchmarks1


Comparing node-4545-community-issue-clickup-trigger-consistently-returns-errors (90517fa) with master (b1c52da)

Open in CodSpeed

Footnotes

  1. 20 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...xecution-context/utils/request-helper-functions.ts 66.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Performance Comparison

Comparing currentlatest master14-day baseline

PR perf tests not yet enabled. Current = latest master run.

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-n8n 1269.76 MB (σ 0.00)
docker-image-size-runners 390.33 MB (σ 9.21)

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-rss-baseline 290.51 MB (σ 41.09)
memory-heap-used-baseline 114.37 MB (σ 0.40)

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-heap-used-baseline 186.42 MB (σ 0.27)
instance-ai-rss-baseline 364.63 MB (σ 22.57)
How to read this table
  • Current: This PR's value (or latest master if PR perf tests haven't run)
  • Latest Master: Most recent nightly master measurement
  • Baseline: Rolling 14-day average from master
  • vs Master: PR impact (current vs latest master)
  • vs Baseline: Drift from baseline (current vs rolling avg)
  • Status: ✅ within 1σ | ⚠️ 1-2σ | 🔴 >2σ regression

DawidMyslak
DawidMyslak previously approved these changes Apr 20, 2026
Comment thread packages/nodes-base/nodes/ClickUp/GenericFunctions.ts Outdated
Co-authored-by: Dawid Myslak <dawid.myslak@gmail.com>
@RomanDavydchuk
Copy link
Copy Markdown
Contributor Author

@DawidMyslak GH dismissed your approval after I applied your suggestion 😅 Not the best UX, can you reapprove please?

@RomanDavydchuk RomanDavydchuk added this pull request to the merge queue Apr 20, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 20, 2026
@RomanDavydchuk RomanDavydchuk added this pull request to the merge queue Apr 20, 2026
Merged via the queue into master with commit 19aadf1 Apr 20, 2026
56 checks passed
@RomanDavydchuk RomanDavydchuk deleted the node-4545-community-issue-clickup-trigger-consistently-returns-errors branch April 20, 2026 10:55
@n8n-assistant n8n-assistant Bot mentioned this pull request Apr 21, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 21, 2026

Got released with n8n@2.18.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ClickUp trigger consistently returns errors and is unstable

2 participants