Canvas preview now tracks latest artifact automatically
When a new artifact is built or an existing one updates, the canvas preview now switches to display it immediately—eliminating the need to manually find and select the latest version.
The canvas preview in the editor wasn't keeping up with the latest work. When a new artifact was created or an existing one was updated, the preview would stay locked on whatever artifact the user had last selected, leaving the fresh build invisible until someone manually switched tabs.
The fix removes three conditional blocks that were intentionally blocking preview switches when the preview was already open on a different artifact. With these guards gone, the system now automatically switches to and refreshes the latest artifact whenever one is created or modified. Users no longer need to hunt for their most recent work—it surfaces immediately.
This affects the AI canvas preview in the n8n editor frontend.
View Original GitHub Description
Summary
Make us switch to the latest artifact when new ones are created / old ones are updated.
Related Linear tickets, Github issues, and Community forum posts
We don’t show the new artifact when one was built already
<!-- Include links to **Linear ticket** or Github issue or Community forum post. Important in order to close *automatically* and provide context to reviewers. https://linear.app/n8n/issue/[TICKET-ID] --> <!-- Use "closes #<issue-number>", "fixes #<issue-number>", or "resolves #<issue-number>" to automatically close issues when the PR is merged. -->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) <!-- **Remember, the title automatically goes into the changelog. Use `(no-changelog)` otherwise.** -->
- Docs updated or follow-up ticket created.
- Tests included. <!-- A bug is not considered fixed, unless a test is added to prevent it from happening again. A feature is not complete without tests. -->
- PR Labeled with
Backport to Beta,Backport to Stable, orBackport to v1(if the PR is an urgent fix that needs to be backported)