Skip to content

Commit e69facb

Browse files
committed
fixes;
1 parent ac038f9 commit e69facb

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

apps/sim/executor/variables/resolvers/parallel.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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

apps/sim/stores/workflows/workflow/store.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { getBlockOutputs } from '@/lib/workflows/blocks/block-outputs'
77
import { TriggerUtils } from '@/lib/workflows/triggers/triggers'
88
import { getBlock } from '@/blocks'
99
import type { SubBlockConfig } from '@/blocks/types'
10-
import { normalizeName } from '@/executor/constants'
10+
import { normalizeName, RESERVED_BLOCK_NAMES } from '@/executor/constants'
1111
import { useWorkflowRegistry } from '@/stores/workflows/registry/store'
1212
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
1313
import { 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,

0 commit comments

Comments
 (0)