File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
executor/variables/resolvers
stores/workflows/workflow Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -73,8 +73,10 @@ export class ParallelResolver implements Resolver {
7373
7474 const [ _ , property , ...pathParts ] = parts
7575 if ( ! ParallelResolver . KNOWN_PROPERTIES . includes ( property ) ) {
76- const isCollection = parallelConfig . parallelType === 'collection'
77- const availableFields = isCollection ? [ 'index' , 'currentItem' , 'items' ] : [ 'index' ]
76+ const hasDistributionItems =
77+ distributionItems !== undefined &&
78+ ( Array . isArray ( distributionItems ) ? distributionItems . length > 0 : true )
79+ const availableFields = hasDistributionItems ? [ 'index' , 'currentItem' , 'items' ] : [ 'index' ]
7880 throw new InvalidFieldError ( 'parallel' , property , availableFields )
7981 }
8082
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { getBlockOutputs } from '@/lib/workflows/blocks/block-outputs'
77import { TriggerUtils } from '@/lib/workflows/triggers/triggers'
88import { getBlock } from '@/blocks'
99import type { SubBlockConfig } from '@/blocks/types'
10- import { normalizeName } from '@/executor/constants'
10+ import { normalizeName , RESERVED_BLOCK_NAMES } from '@/executor/constants'
1111import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1212import { useSubBlockStore } from '@/stores/workflows/subblock/store'
1313import { filterNewEdges , getUniqueBlockName , mergeSubblockState } from '@/stores/workflows/utils'
@@ -726,6 +726,11 @@ export const useWorkflowStore = create<WorkflowStore>()(
726726 return { success : false , changedSubblocks : [ ] }
727727 }
728728
729+ if ( ( RESERVED_BLOCK_NAMES as readonly string [ ] ) . includes ( normalizedNewName ) ) {
730+ logger . error ( `Cannot rename block to reserved name: "${ name } "` )
731+ return { success : false , changedSubblocks : [ ] }
732+ }
733+
729734 const newState = {
730735 blocks : {
731736 ...get ( ) . blocks ,
You can’t perform that action at this time.
0 commit comments