@@ -57,6 +57,7 @@ import {
57
57
import I18n from '@/context/i18n'
58
58
import { CollectionType } from '@/app/components/tools/types'
59
59
import { CUSTOM_ITERATION_START_NODE } from '@/app/components/workflow/nodes/iteration-start/constants'
60
+ import { useWorkflowConfig } from '@/service/use-workflow'
60
61
61
62
export const useIsChatMode = ( ) => {
62
63
const appDetail = useAppStore ( s => s . appDetail )
@@ -69,7 +70,9 @@ export const useWorkflow = () => {
69
70
const { locale } = useContext ( I18n )
70
71
const store = useStoreApi ( )
71
72
const workflowStore = useWorkflowStore ( )
73
+ const appId = useStore ( s => s . appId )
72
74
const nodesExtraData = useNodesExtraData ( )
75
+ const { data : workflowConfig } = useWorkflowConfig ( appId )
73
76
const setPanelWidth = useCallback ( ( width : number ) => {
74
77
localStorage . setItem ( 'workflow-node-panel-width' , `${ width } ` )
75
78
workflowStore . setState ( { panelWidth : width } )
@@ -336,15 +339,15 @@ export const useWorkflow = () => {
336
339
for ( let i = 0 ; i < parallelList . length ; i ++ ) {
337
340
const parallel = parallelList [ i ]
338
341
339
- if ( parallel . depth > PARALLEL_DEPTH_LIMIT ) {
342
+ if ( parallel . depth > ( workflowConfig ?. parallel_depth_limit || PARALLEL_DEPTH_LIMIT ) ) {
340
343
const { setShowTips } = workflowStore . getState ( )
341
- setShowTips ( t ( 'workflow.common.parallelTip.depthLimit' , { num : PARALLEL_DEPTH_LIMIT } ) )
344
+ setShowTips ( t ( 'workflow.common.parallelTip.depthLimit' , { num : ( workflowConfig ?. parallel_depth_limit || PARALLEL_DEPTH_LIMIT ) } ) )
342
345
return false
343
346
}
344
347
}
345
348
346
349
return true
347
- } , [ t , workflowStore ] )
350
+ } , [ t , workflowStore , workflowConfig ?. parallel_depth_limit ] )
348
351
349
352
const isValidConnection = useCallback ( ( { source, sourceHandle, target } : Connection ) => {
350
353
const {
0 commit comments