Skip to content

feat(editor): Add node-context chat telemetry (no-changelog) - #36912

Draft
jgalmeida wants to merge 1 commit into
claude/ado-5773-front-end-bc4413from
claude/ado-5793-telemetry
Draft

feat(editor): Add node-context chat telemetry (no-changelog)#36912
jgalmeida wants to merge 1 commit into
claude/ado-5773-front-end-bc4413from
claude/ado-5793-telemetry

Conversation

@jgalmeida

@jgalmeida jgalmeida commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds telemetry for the "add nodes to chat" (node context) feature, per https://linear.app/n8n/issue/ADO-5793. Two events in the INSTANCE_AI domain of the @n8n/telemetry registry.

Stacked on the feature branch (base is claude/ado-5773-front-end-bc4413, PR #36225), so the diff here is only the telemetry commit.

Events

Event Properties Fires
User added nodes to chat source, node_count The shared addSelectedNodesToChat chokepoint, after the attachment is built — so node_count is the count actually attached (unresolved ids dropped, capped at the per-set max), not the raw selection. source is threaded from each Canvas trigger.
User sent chat message with nodes node_count Both send paths (empty view + thread view), only when the message carries node context. node_count totals nodes across every attached set.

source values: node_toolbar, selection_toolbar, context_menu, group_title_bar, keyboard.

Kept intentionally minimal (source + count) — no thread_id/instance_id (PostHog already carries session identity), no set-count.

Testing

  • FE unit tests: 6 new (4 for useAddNodesToChat source/count, 2 for the countAttachedNodes helper); mock useTelemetry().track and assert the registry entry + payload.
  • @n8n/telemetry registry checks pass (descriptions non-blank, JSON-schema-representable).
  • pnpm typecheck (editor-ui) clean — confirms every track() payload matches its zod schema.
  • eslint clean on all touched files.

🤖 Generated with Claude Code

Review in cubic

Two INSTANCE_AI events for the add-nodes-to-chat feature:
- "User added nodes to chat" (source + node_count), fired from the
  shared addSelectedNodesToChat chokepoint with the source threaded
  from each Canvas trigger (node toolbar, selection toolbar, context
  menu, group title bar, keyboard).
- "User sent chat message with nodes" (node_count), fired from both
  send paths when the message carries node context.

https://linear.app/n8n/issue/ADO-5793

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...src/features/ai/instanceAi/InstanceAiEmptyView.vue 50.00% 1 Missing and 1 partial ⚠️
...rc/features/ai/instanceAi/InstanceAiThreadView.vue 50.00% 1 Missing ⚠️
...rc/features/workflows/canvas/components/Canvas.vue 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant Bot added the n8n team Authored by the n8n team label Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed n8n team Authored by the n8n team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant