diff --git a/web/src/views/Workflow/hooks/useWorkflowGraph.ts b/web/src/views/Workflow/hooks/useWorkflowGraph.ts index a7ebb29a..615cd3e5 100644 --- a/web/src/views/Workflow/hooks/useWorkflowGraph.ts +++ b/web/src/views/Workflow/hooks/useWorkflowGraph.ts @@ -729,6 +729,9 @@ export const useWorkflowGraph = ({ validateConnection({ sourceCell, targetCell, targetMagnet }) { if (!targetMagnet) return false; + // 节点不能与自己连线 + if (sourceCell?.id === targetCell?.id) return false; + const sourceType = sourceCell?.getData()?.type; const targetType = targetCell?.getData()?.type;