Skip to content

revert: Make n8n-workflow a peer dependency in ai-utilities#26420

Closed
DawidMyslak wants to merge 1 commit intomasterfrom
revert-ai-utilities-peer-dep
Closed

revert: Make n8n-workflow a peer dependency in ai-utilities#26420
DawidMyslak wants to merge 1 commit intomasterfrom
revert-ai-utilities-peer-dep

Conversation

@DawidMyslak
Copy link
Copy Markdown
Contributor

@DawidMyslak DawidMyslak commented Mar 2, 2026

Summary

Reverts #26404. Moving n8n-workflow from dependencies to peerDependencies in @n8n/ai-utilities broke the monorepo build — peer deps aren't automatically resolved for the package itself during build, so ai-utilities can no longer find n8n-workflow.

The proper fix needs n8n-workflow in both devDependencies (for monorepo build) and peerDependencies (for npm consumers). Will follow up with a corrected PR.

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/NODE-4532

Review / Merge checklist

  • PR title and summary are descriptive. (conventions)
  • Docs updated or follow-up ticket created.
  • Tests included.
  • PR Labeled with release/backport (if the PR is an urgent fix that needs to be backported)

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

Architecture diagram
sequenceDiagram
    participant Build as Build System (Monorepo)
    participant AI as @n8n/ai-utilities
    participant WF as n8n-workflow
    participant Run as n8n Runtime

    Note over Build, WF: Build-time Resolution (Restored)
    Build->>AI: Start build/transpilation
    AI->>Build: Resolve module "n8n-workflow"
    
    alt Dependency Found
        Build->>WF: CHANGED: Locate via "dependencies" (workspace:*)
        WF-->>AI: Provide type definitions & source
        AI-->>Build: Compilation success
    else Peer Dependency Error (Reverted State)
        Build--xAI: Fails to resolve (Peer deps not auto-linked in build)
    end

    Note over AI, Run: Runtime Control Flow
    Run->>AI: Call AI utility function
    AI->>WF: Access shared workflow primitives (Interfaces/Classes)
    WF-->>AI: Context/Data
    AI-->>Run: Return AI process result
Loading

@n8n-assistant n8n-assistant Bot added the n8n team Authored by the n8n team label Mar 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blacksmith-sh
Copy link
Copy Markdown

blacksmith-sh Bot commented Mar 2, 2026

Found 1 test failure on Blacksmith runners:

Failure

Test View Logs
tests/e2e/workflows/editor/canvas/canvas-nodes.spec.ts/
Canvas Node Manipulation and Navigation › should add switch node and test connections
View Logs

Fix in Cursor

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant