Skip to content

feat(editor): Change default node names depending on node operation and resource #15954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

CharlieKolb
Copy link
Contributor

@CharlieKolb CharlieKolb commented Jun 3, 2025

Summary

Replace the current default names for nodes with dynamic ones based on operations and/or resources if available.

For tools also append the node name since they will be provided to the AI Agent.

Also moved an isTool implementation to NodeHelpers since it seems like the best one I've seen so far.

Not really happy with the implementation in useActions but I can't think of better alternatives :/

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-3437/feature-auto-name-nodes

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

codecov bot commented Jun 3, 2025

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Jun 3, 2025
@CharlieKolb CharlieKolb changed the title Add dynamic node names feat(editor): Change default node names depending on node operation and resource Jun 4, 2025
@CharlieKolb CharlieKolb marked this pull request as ready for review June 4, 2025 14:51
Copy link
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.

cubic found 3 issues across 4 files. Review them in cubic.dev

React with 👍 or 👎 to teach cubic. Tag @cubic-dev-ai to give specific feedback.


export const useActions = () => {
const nodeCreatorStore = useNodeCreatorStore();
const nodeTypesStore = useNodeTypesStore();
const i18n = useI18n();
const canvasOperations = useCanvasOperations({ router: useRouter() });
Copy link
Contributor

Choose a reason for hiding this comment

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

Creating router instance inside a composable may lead to multiple router instances. The router should be injected from the parent component.

Suggested change
const canvasOperations = useCanvasOperations({ router: useRouter() });
const canvasOperations = useCanvasOperations({ router });

@CharlieKolb CharlieKolb requested a review from RicardoE105 June 4, 2025 15:03
@CharlieKolb CharlieKolb requested review from a team, nikhilkuria and schrothbn and removed request for a team and RicardoE105 June 6, 2025 07:01
@CharlieKolb
Copy link
Contributor Author

@schrothbn I moved the isTool utility you added to NodeHelpers since it'll be very handy to have access to in general, let me know if that looks good to you 🙏

parameters: INodeParameters,
): boolean {
// Check if node is a vector store in retrieve-as-tool mode
if (nodeTypeDescription.name.includes('vectorStore')) {
Copy link
Contributor

Choose a reason for hiding this comment

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

[Question] is the implementation here is different from what we had at is-tool.ts ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good eye! node.type is equivalent to nodeTypeDescription.name, and this makes for a more convenient API since we already need the description anyway. But definitely want @schrothbn eye on this as well!

Cadiac
Cadiac previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Cadiac
Cadiac previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

nikhilkuria
nikhilkuria previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

@CharlieKolb CharlieKolb dismissed stale reviews from nikhilkuria and Cadiac via 0785842 June 6, 2025 13:08
nikhilkuria
nikhilkuria previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

nikhilkuria
nikhilkuria previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

nikhilkuria
nikhilkuria previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

nikhilkuria
nikhilkuria previously approved these changes Jun 6, 2025
Copy link
Contributor

github-actions bot commented Jun 6, 2025

⚠️ Some Cypress E2E specs are failing, please fix them before merging

Copy link

cypress bot commented Jun 6, 2025

n8n    Run #11356

Run Properties:  status check failed Failed #11356  •  git commit ec6f51605f: 🌳 ADO-3437 🤖 CharlieKolb 🗃️ e2e/5-ndv.cy.ts
Project n8n
Branch Review ADO-3437
Run status status check failed Failed #11356
Run duration 04m 17s
Commit git commit ec6f51605f: 🌳 ADO-3437 🤖 CharlieKolb 🗃️ e2e/5-ndv.cy.ts
Committer Charlie Kolb
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 40
View all changes introduced in this branch ↗︎

Tests for review

Failed  e2e/5-ndv.cy.ts • 1 failed test

View Output Video

Test Artifacts
NDV > should show validation errors only after blur or re-opening of NDV of nodes without operation and resource Screenshots Video

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants