Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: knowledge pipeline can not published (#28203)

非法操作1e6d0de48bbc
diff --git a/web/app/components/workflow/hooks/use-checklist.ts b/web/app/components/workflow/hooks/use-checklist.ts
index 8c4ec7299e9..be7aabbc68a 100644
--- a/web/app/components/workflow/hooks/use-checklist.ts
+++ b/web/app/components/workflow/hooks/use-checklist.ts
@@ -249,6 +249,8 @@ export const useChecklistBeforePublish = () => {
const { data: buildInTools } = useAllBuiltInTools()
const { data: customTools } = useAllCustomTools()
const { data: workflowTools } = useAllWorkflowTools()
+ const appMode = useAppStore.getState().appDetail?.mode
+ const shouldCheckStartNode = appMode === AppModeEnum.WORKFLOW || appMode === AppModeEnum.ADVANCED_CHAT
const getCheckData = useCallback((data: CommonNodeType<{}>, datasets: DataSet[]) => {
let checkData = data
@@ -366,17 +368,22 @@ export const useChecklistBeforePublish = () => {
}
}
- if (!validNodes.find(n => n.id === node.id)) {
+ const isStartNodeMeta = nodesExtraData?.[node.data.type as BlockEnum]?.metaData.isStart ?? false
+ const canSkipConnectionCheck = shouldCheckStartNode ? isStartNodeMeta : true
+ const isUnconnected = !validNodes.find(n => n.id === node.id)
+
+ if (isUnconnected && !canSkipConnectionCheck) {
notify({ type: 'error', message: `[${node.data.title}] ${t('workflow.common.needConnectTip')}` })
return false
}
}
- const startNodesFiltered = nodes.filter(node => START_NODE_TYPES.includes(node.data.type as BlockEnum))
-
- if (startNodesFiltered.length === 0) {
- notify({ type: 'error', message: t('workflow.common.needStartNode') })
- return false
+ if (shouldCheckStartNode) {
+ const startNodesFiltered = nodes.filter(node => START_NODE_TYPES.includes(node.data.type as BlockEnum))
+ if (startNodesFiltered.length === 0) {
+ notify({ type: 'error', message: t('workflow.common.needStartNode') })
+ return false
+ }
}
const isRequiredNodesType = Object.keys(nodesExtraData!).filter((key: any) => (nodesExtraData as any)[key].metaData.isRequired)
@@ -391,7 +398,7 @@ export const useChecklistBeforePublish = () => {
}
return true
- }, [store, notify, t, language, nodesExtraData, strategyProviders, updateDatasetsDetail, getCheckData, workflowStore, buildInTools, customTools, workflowTools])
+ }, [store, notify, t, language, nodesExtraData, strategyProviders, updateDatasetsDetail, getCheckData, workflowStore, buildInTools, customTools, workflowTools, shouldCheckStartNode])
return {
handleCheckBeforePublish,