diff --git a/projects/app/src/web/core/workflow/utils.ts b/projects/app/src/web/core/workflow/utils.ts index 9b530f2173b..4ef7ff6a7f6 100644 --- a/projects/app/src/web/core/workflow/utils.ts +++ b/projects/app/src/web/core/workflow/utils.ts @@ -16,7 +16,7 @@ import { EmptyNode } from '@fastgpt/global/core/workflow/template/system/emptyNo import { StoreEdgeItemType } from '@fastgpt/global/core/workflow/type/edge'; import { getNanoid } from '@fastgpt/global/common/string/tools'; import { getGlobalVariableNode } from './adapt'; -import { WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants'; +import { VARIABLE_NODE_ID, WorkflowIOValueTypeEnum } from '@fastgpt/global/core/workflow/constants'; import { NodeInputKeyEnum, NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants'; import { EditorVariablePickerType } from '@fastgpt/web/components/common/Textarea/PromptEditor/type'; import { @@ -425,6 +425,10 @@ export const checkWorkflowNodeAndConnection = ({ if (!nodeId || !outputId) return false; + if (nodeId === VARIABLE_NODE_ID) { + return true; + } + return !!nodes .find((node) => node.data.nodeId === nodeId) ?.data.outputs.find((output) => output.id === outputId);