Bug Description
On self-hosted instances with a large usable-credentials set (~2k), opening the Node Details View (NDV) for credential-using nodes (e.g. OpenAI Chat Model) freezes the UI for many seconds (observed ~5–22s).
Chrome Performance profiling shows the cost is almost entirely frontend main-thread work inside useNodeCredentialOptions during the dblclick handler — not network, database, or workflow size.
Hot path:
getCredentialOptionsbuilds dropdown options with{...option}over Vue reactive usable credentials, which tracks every field.isCredentialExistingrebuilds that full options list just to check one credential id.
This scales with instance usable-credentials size. A smaller instance on the same build (~600 credentials) does not show the lag. Reproduced on a brand-new empty workflow with only a newly added OpenAI Chat Model node.
Proposed fix
PR: https://github.com/n8n-io/n8n/pull/40198
- Spread
toRaw(option)when building options - O(1)
usableCredentialsmap lookup for existence checks - Keep
overrideCredentialspath for Instance AI
Validation
After applying the fix on a large self-hosted instance: NDV open dropped from ~ to ~ in Chrome Performance traces.