Skip to content

fix(editor): Improve setup wizard placeholder detection and card completion scoping#28474

Merged
aalises merged 5 commits intomasterfrom
ai-2368-fix-setup-wizard-placeholder-detection
Apr 17, 2026
Merged

fix(editor): Improve setup wizard placeholder detection and card completion scoping#28474
aalises merged 5 commits intomasterfrom
ai-2368-fix-setup-wizard-placeholder-detection

Conversation

@aalises
Copy link
Copy Markdown
Contributor

@aalises aalises commented Apr 14, 2026

Summary

  • Scope isCardComplete() placeholder check to only trackedParamNames instead of the entire node parameters, so hidden placeholders in un-rendered params don't block card completion
  • Improve backend buildSetupRequests() placeholder detection to always surface placeholders (even when param already has validation issues) and include the hint label in error messages
  • Add extractPlaceholderLabel() utility to @n8n/utils for extracting human-readable hints from placeholder sentinels

Related Linear tickets

…letion scoping

Scope isCardComplete() placeholder check to only tracked parameters instead of
the entire node, so hidden placeholders in un-rendered params don't block card
completion. Also improve backend placeholder detection to always surface
placeholders (even when param already has validation issues) and include the
hint label in the error message.
@aalises aalises marked this pull request as ready for review April 14, 2026 12:46
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Bundle Report

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

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

Affected Assets, Files, and Routes:

view changes for bundle: editor-ui-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/constants-*.js 214 bytes 3.14MB 0.01%
assets/index-*.js -7 bytes 1.31MB -0.0%
assets/ParameterInputList-*.js 193 bytes 1.27MB 0.02%
assets/users.store-*.js 5.31kB 1.06MB 0.5%
assets/core-*.js 4.47kB 627.95kB 0.72%
assets/RunData-*.js 26 bytes 345.87kB 0.01%
assets/InstanceAiView-*.js 2.22kB 345.67kB 0.65%
assets/WorkflowLayout-*.js -36 bytes 127.8kB -0.03%
assets/router-*.js 21 bytes 119.27kB 0.02%
assets/SettingsSso-*.js 401 bytes 106.37kB 0.38%
assets/settings.store-*.js -18 bytes 80.04kB -0.02%
assets/CreditWarningBanner-*.js -38 bytes 55.17kB -0.07%
assets/SettingsInstanceAiView-*.js 1.83kB 44.62kB 4.28%
assets/AppSidebar-*.js -2 bytes 43.25kB -0.0%
assets/SettingsSso-*.css -59 bytes 34.7kB -0.17%
assets/useRunWorkflow-*.js 3 bytes 27.87kB 0.01%
assets/SettingsInstanceAiView-*.css 161 bytes 23.73kB 0.68%
assets/useCustomAgent-*.js -36 bytes 20.76kB -0.17%
assets/DependencyPill-*.js 29 bytes 10.2kB 0.29%
assets/SettingsAiGatewayView-*.js -19 bytes 10.0kB -0.19%
assets/WorkflowPreview-*.js 182 bytes 7.92kB 2.35%
assets/useSettingsItems-*.js -12 bytes 6.43kB -0.19%
assets/sso.store-*.js 162 bytes 5.96kB 2.8%
assets/ContactAdministratorToInstall-*.js 159 bytes 5.92kB 2.76%
assets/DependencyPill-*.css -23 bytes 5.68kB -0.4%
assets/SettingsLayout-*.js -2 bytes 5.19kB -0.04%
assets/dist-*.js (Deleted) -5.34kB 0 bytes -100.0% 🗑️
assets/useAiGateway-*.js -48 bytes 1.37kB -3.39%

Files in assets/users.store-*.js:

  • ./src/features/ai/assistant/composables/useBuilderTodos.ts → Total Size: 6.05kB

Files in assets/InstanceAiView-*.js:

  • ./src/features/ai/instanceAi/composables/useSetupCards.ts → Total Size: 10.13kB

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 92.85714% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...eatures/ai/instanceAi/composables/useSetupCards.ts 50.00% 2 Missing ⚠️
packages/@n8n/utils/src/placeholder.ts 97.36% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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 5 files

Architecture diagram
sequenceDiagram
    participant UI as Setup Wizard (Frontend)
    participant Store as Node/Editor Store
    participant Service as Setup Workflow Service (Backend)
    participant Utils as Placeholder Utils

    Note over UI, Utils: Flow 1: Backend Placeholder Detection (Setup Request)

    Service->>Service: getParameterIssues()
    loop For each parameter in Node
        Service->>Utils: hasPlaceholderDeep(paramValue)
        Utils-->>Service: boolean
        
        opt has placeholder
            Service->>Utils: NEW: extractPlaceholderLabel(paramValue)
            Utils-->>Service: label (e.g., "api_key")
            
            Service->>Service: CHANGED: Append placeholder issue even if validation issues exist
            Note right of Service: Message includes hint label if found
        end
    end
    Service-->>UI: Return SetupRequests with parameterIssues

    Note over UI, Utils: Flow 2: Frontend Card Completion Logic

    UI->>Store: Get node parameters and trackedParamNames
    UI->>UI: Check getNodeParametersIssues()
    
    alt No validation issues
        loop For each paramName in trackedParamNames
            UI->>UI: CHANGED: Scope placeholder check to tracked params only
            UI->>Utils: hasPlaceholderDeep(storeNode.parameters[paramName])
            Utils-->>UI: boolean
        end
        
        alt No placeholders in tracked params
            UI-->>UI: Mark Card as Complete
        else Placeholder found
            UI-->>UI: Keep Card Incomplete
        end
    else Has validation issues
        UI-->>UI: Keep Card Incomplete
    end
Loading

aalises added 2 commits April 14, 2026 14:53
Tests were rendering the component synchronously without awaiting the
async onMounted that sets isStoreReady. Added renderAndWait helper that
uses waitFor to wait for the loading state to clear before interacting.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 14, 2026

Performance Comparison

Comparing currentlatest master14-day baseline

Idle baseline with Instance AI module loaded

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
instance-ai-rss-baseline 386.05 MB 341.24 MB 368.15 MB (σ 24.08) +13.1% +4.9%
instance-ai-heap-used-baseline 186.83 MB 186.36 MB 186.34 MB (σ 0.22) +0.3% +0.3% 🔴

docker-stats

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
docker-image-size-runners 393.00 MB 393.00 MB 391.78 MB (σ 10.35) +0.0% +0.3%
docker-image-size-n8n 1269.76 MB 1269.76 MB 1269.76 MB (σ 0.00) +0.0% +0.0%

Memory consumption baseline with starter plan resources

Metric Current Latest Master Baseline (avg) vs Master vs Baseline Status
memory-heap-used-baseline 115.36 MB 114.54 MB 114.07 MB (σ 0.54) +0.7% +1.1% 🔴
memory-rss-baseline 223.59 MB 332.36 MB 289.54 MB (σ 44.00) -32.7% -22.8% ⚠️
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

@aalises aalises requested a review from scdekov April 14, 2026 15:28
@scdekov
Copy link
Copy Markdown
Member

scdekov commented Apr 15, 2026

How does this fix https://linear.app/n8n/issue/AI-2368/fix-setup-wizard-error-indicator-persists-after-entering-valid? From what I see the reported issue is not related to the placeholder params but an empty required ones?

Comment thread packages/@n8n/instance-ai/src/tools/workflows/setup-workflow.service.ts Outdated
Comment thread packages/@n8n/utils/src/placeholder.ts Outdated
@aalises
Copy link
Copy Markdown
Contributor Author

aalises commented Apr 15, 2026

How does this fix https://linear.app/n8n/issue/AI-2368/fix-setup-wizard-error-indicator-persists-after-entering-valid? From what I see the reported issue is not related to the placeholder params but an empty required ones?

True! must've slipped in the stacking of PRs (like the unrelated changes), will remove the unrelated changes and the link to this issue

aalises added 2 commits April 15, 2026 10:59
Consolidate duplicate placeholder detection logic by moving
extractPlaceholderLabels, findPlaceholderDetails, formatPlaceholderPath,
isPlaceholderValue, and PlaceholderDetail to @n8n/utils/placeholder.ts.
The useBuilderTodos module now re-exports from @n8n/utils.
Use findPlaceholderDetails instead of hasPlaceholderDeep +
extractPlaceholderLabel, removing the dead code fallback for
empty-label placeholders.
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.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/@n8n/instance-ai/src/tools/workflows/setup-workflow.service.ts">

<violation number="1" location="packages/@n8n/instance-ai/src/tools/workflows/setup-workflow.service.ts:74">
P1: Placeholder detection now misses unlabeled placeholder sentinels because it only checks `findPlaceholderDetails(...).length > 0` (which excludes empty-label placeholders).</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

if (!parameterIssues[paramName] && hasPlaceholderDeep(paramValue)) {
parameterIssues[paramName] = ['Contains a placeholder value - please provide the real value'];
const details = findPlaceholderDetails(paramValue);
if (details.length > 0) {
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot Apr 15, 2026

Choose a reason for hiding this comment

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

P1: Placeholder detection now misses unlabeled placeholder sentinels because it only checks findPlaceholderDetails(...).length > 0 (which excludes empty-label placeholders).

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/@n8n/instance-ai/src/tools/workflows/setup-workflow.service.ts, line 74:

<comment>Placeholder detection now misses unlabeled placeholder sentinels because it only checks `findPlaceholderDetails(...).length > 0` (which excludes empty-label placeholders).</comment>

<file context>
@@ -70,11 +70,9 @@ export async function buildSetupRequests(
-				? `Placeholder "${label}" — please provide the real value`
-				: 'Contains a placeholder value — please provide the real value';
+		const details = findPlaceholderDetails(paramValue);
+		if (details.length > 0) {
+			const message = `Placeholder "${details[0].label}" — please provide the real value`;
 			if (parameterIssues[paramName]) {
</file context>
Fix with Cubic

@aalises aalises added this pull request to the merge queue Apr 17, 2026
Merged via the queue into master with commit d172113 Apr 17, 2026
73 checks passed
@aalises aalises deleted the ai-2368-fix-setup-wizard-placeholder-detection branch April 17, 2026 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants