Skip to content

fix(ai-builder): Unify post-build credential setup into single setup-workflow flow#28273

Merged
aalises merged 1 commit intomasterfrom
aalises-setup-instructions
Apr 10, 2026
Merged

fix(ai-builder): Unify post-build credential setup into single setup-workflow flow#28273
aalises merged 1 commit intomasterfrom
aalises-setup-instructions

Conversation

@aalises
Copy link
Copy Markdown
Contributor

@aalises aalises commented Apr 9, 2026

Summary

  • Remove credential finalization (setup-credentials + apply-workflow-credentials) from the builder sub-agent — the builder now only builds and verifies
  • Update workflow loop guidance to point to setup-workflow instead of the old setup-credentialsapply-workflow-credentials chain
  • Add explicit deferral guardrail in system prompt: when setup-workflow returns deferred: true, do not retry with a different setup tool
  • Tighten system prompt to clarify setup-credentials is only for standalone credential creation outside workflow context

Fixes duplicate setup prompts where users saw first a credential picker (setup-credentials), then the full setup panel (setup-workflow) after building a workflow.

  • I have seen this code, I have run this code, and I take responsibility for this code.

…-workflow flow (no-changelog)

Remove credential finalization from builder sub-agent and consolidate
into a single orchestrator-driven setup-workflow call. Previously the
builder called setup-credentials (finalize) + apply-workflow-credentials,
and then the orchestrator could call setup-workflow again — producing
duplicate setup prompts with different UIs.

Now the builder only builds and verifies. The orchestrator exclusively
calls setup-workflow post-build, which handles credentials, parameters,
and triggers in one unified UI. Deferral guidance prevents retrying with
a different setup tool.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant Bot added the n8n team Authored by the n8n team label Apr 9, 2026
@aalises aalises marked this pull request as ready for review April 9, 2026 22:14
@aalises aalises changed the title fix(instance-ai): Unify post-build credential setup into single setup-workflow flow fix(ai-builder): Unify post-build credential setup into single setup-workflow flow Apr 9, 2026
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 Agent as AI Orchestrator
    participant Builder as Builder Sub-Agent
    participant Tools as Tools API
    participant UI as Frontend UI

    Note over Agent,UI: Post-Build Workflow Flow

    Agent->>Builder: Start build task
    Builder->>Tools: verify-built-workflow()
    Tools-->>Builder: Success (with mocked credentials)
    
    Builder-->>Agent: Task Complete (workflowId, mocks found)
    
    Note over Agent,Tools: CHANGED: Unified Setup Flow
    Agent->>Tools: NEW: setup-workflow(workflowId)
    Tools->>UI: Open Setup Panel (Credentials + Params)
    
    alt User configures now
        UI-->>Tools: Configuration completed
        Tools-->>Agent: success: true
        Agent->>UI: "Workflow ready. Would you like to test it?"
    else User clicks "Later"
        UI-->>Tools: User deferred setup
        Tools-->>Agent: NEW: deferred: true
        Note right of Agent: NEW: Guardrail prevents retrying <br/>with setup-credentials
        Agent->>UI: "No problem. You can set it up later. <br/>Ready to test?"
    end

    Note over Agent,UI: Standalone Credential Flow (Outside Workflow)
    
    UI->>Agent: "Create a Slack credential"
    Agent->>Tools: CHANGED: setup-credentials(stage: "create")
    Tools->>UI: Open Credential Modal
    UI-->>Agent: Credential created/selected
Loading

@aalises aalises requested a review from Cadiac April 10, 2026 07:28
@Cadiac
Copy link
Copy Markdown
Contributor

Cadiac commented Apr 10, 2026

⚠️ Ownership acknowledgement required

Please add or check the following item in your PR description before this can be merged:

- [x] I have seen this code, I have run this code, and I take responsibility for this code.

what :D

Copy link
Copy Markdown
Contributor

@Cadiac Cadiac left a comment

Choose a reason for hiding this comment

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

Seems like this makes sense, but didn't test locally

@aalises aalises added this pull request to the merge queue Apr 10, 2026
Merged via the queue into master with commit 8f8b70a Apr 10, 2026
104 of 109 checks passed
@aalises aalises deleted the aalises-setup-instructions branch April 10, 2026 08:18
@n8n-assistant n8n-assistant Bot mentioned this pull request Apr 13, 2026
@n8n-assistant
Copy link
Copy Markdown
Contributor

n8n-assistant Bot commented Apr 14, 2026

Got released with n8n@

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

Labels

n8n team Authored by the n8n team Released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants