Skip to content

feat(editor): Improve manual description in nodes as tools #15373

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

Conversation

RicardoE105
Copy link
Contributor

@RicardoE105 RicardoE105 commented May 14, 2025

Summary

This PR enhances the way manual descriptions are generated for nodes used as AI tools. It introduces a more descriptive and context-aware approach for generating tool descriptions that better reflect the actual functionality of nodes.

What's Changed

Behavior Details

  • Existing nodes: For nodes already set up with the default description, they will keep it to avoid breaking existing workflows
  • Updates: Descriptions will only be updated automatically when opening the node and changing the resource or operation
  • New nodes: For newly created nodes, the description will be automatically generated
  • Manual edits: If the user updates the description manually, it will stop being updated automatically

New Helper Functions

Added two new utility functions in NodeHelpers.ts:

  • makeDescription(): Generates human-readable descriptions for nodes based on their parameters and type definition

    • Formats generated:
      • {action} in {displayName} - when operation has a defined action (e.g., "Create a new user in HTTP Request")
      • {operation} {resource} in {displayName} - when resource and operation exist but action is missing (e.g., "create user in HTTP Request")
  • Node's default description - as fallback when resource or operation is missing

  • getToolDescription(): Determines when tool descriptions should be updated and calculates the new description

Updates to Node Settings Component

  • Modified NodeSettings.vue to automatically update the tool description when parameters change

Demo

CleanShot 2025-05-13 at 21 28 25

Related Linear tickets, Github issues, and Community forum posts

https://linear.app/n8n/issue/ADO-3097/spike-better-set-manually-defaults-for-nodes-as-tools

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)

@RicardoE105 RicardoE105 changed the title Improve manual node description in nodes as tools feat(editor): Improve manual node description in nodes as tools May 14, 2025
Copy link

@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.

mrge found 2 issues across 5 files. Review them in mrge.io

Copy link

codecov bot commented May 14, 2025

Codecov Report

Attention: Patch coverage is 71.42857% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...frontend/editor-ui/src/components/NodeSettings.vue 0.00% 10 Missing ⚠️
packages/workflow/src/NodeHelpers.ts 93.33% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels May 14, 2025
@RicardoE105 RicardoE105 changed the title feat(editor): Improve manual node description in nodes as tools feat(editor): Improve manual description in nodes as tools May 14, 2025
@RicardoE105 RicardoE105 requested a review from CharlieKolb May 14, 2025 01:43
@RicardoE105 RicardoE105 removed the request for review from CharlieKolb May 14, 2025 02:36
@RicardoE105 RicardoE105 marked this pull request as draft May 14, 2025 02:36
@RicardoE105 RicardoE105 requested a review from CharlieKolb May 14, 2025 02:56
@RicardoE105 RicardoE105 marked this pull request as ready for review May 14, 2025 14:01
Copy link

@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.

mrge found 3 issues across 7 files. Review them in mrge.io

@@ -547,6 +548,18 @@ const valueChanged = (parameterData: IUpdateInformation) => {
nodeType,
);

if (isToolNode.value) {
Copy link

Choose a reason for hiding this comment

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

Rule violated: Ensure every PR has unit tests for Vue files

  Missing unit tests for the modified NodeSettings.vue component

CharlieKolb
CharlieKolb previously approved these changes May 14, 2025
Copy link
Contributor

@CharlieKolb CharlieKolb left a comment

Choose a reason for hiding this comment

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

Nice work! Happy to merge as is, I did leave a note on Slack to suggest that we should also update if the description is an empty string (after .trim()) so that users have a way of getting the automated description back if they mess with it

Copy link
Contributor

✅ All Cypress E2E specs passed

Copy link
Contributor

@CharlieKolb CharlieKolb left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

✅ All Cypress E2E specs passed

@RicardoE105 RicardoE105 merged commit 726438d into master May 15, 2025
33 checks passed
@RicardoE105 RicardoE105 deleted the ado-3097-spike-better-set-manually-defaults-for-nodes-as-tools branch May 15, 2025 14:45
@github-actions github-actions bot mentioned this pull request May 19, 2025
@janober
Copy link
Member

janober commented May 19, 2025

Got released with [email protected]

ozcangungor pushed a commit to ozcangungor/n8n that referenced this pull request May 25, 2025
etobella pushed a commit to etobella/n8n that referenced this pull request May 25, 2025
Alexandero89 pushed a commit to Alexandero89/n8n that referenced this pull request May 28, 2025
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.

3 participants