Copy nodes gives wrong tool naming
Self Checks
- [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
- [X] I have searched for existing issues search for existing issues, including closed ones.
- [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
- [X] Please do not modify this template :) and fill in all the required fields.
Dify version
0.6.8
Cloud or Self Hosted
Cloud, Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
Copy nodes and tool
✔️ Expected Behavior
The name of both the tool node and the llm node should become "Custom node name 2" "DuckDuckGo Search 2"
❌ Actual Behavior
Tool node became "workflow.blocks.tool 2" and llm node became "LLM 2"
The issue with the incorrect naming of copied nodes in Dify version 0.6.8 is due to the NODES_INITIAL_DATA not including custom titles for these nodes. The titles are set to empty strings, which results in the default naming convention being applied when nodes are copied.
To fix this, you need to set the title property for each node type in the NODES_INITIAL_DATA to the desired custom node names. For example:
export const NODES_INITIAL_DATA = {
[BlockEnum.Start]: {
type: BlockEnum.Start,
title: 'Start Node',
desc: '',
...StartNodeDefault.defaultValue,
},
[BlockEnum.End]: {
type: BlockEnum.End,
title: 'End Node',
desc: '',
...EndNodeDefault.defaultValue,
},
[BlockEnum.Answer]: {
type: BlockEnum.Answer,
title: 'Answer Node',
desc: '',
...AnswerDefault.defaultValue,
},
[BlockEnum.LLM]: {
type: BlockEnum.LLM,
title: 'DuckDuckGo Search',
desc: '',
variables: [],
...LLMDefault.defaultValue,
},
[BlockEnum.Tool]: {
type: BlockEnum.Tool,
title: 'Custom node name',
desc: '',
...ToolDefault.defaultValue,
},
// Add titles for other nodes as needed
}
By ensuring that the title property in NODES_INITIAL_DATA is set correctly, the copied nodes should have the expected names.
Details
Sources
- web/app/components/workflow/constants.ts
- web/app/components/workflow/hooks/use-nodes-interactions.ts
About Dosu This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
To continue the conversation, mention @dosu.