Skip to content

Commit aaabcf9

Browse files
committed
fix parallel
1 parent b7f2578 commit aaabcf9

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

apps/sim/executor/orchestrators/parallel.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class ParallelOrchestrator {
6464
try {
6565
items = this.resolveDistributionItems(ctx, parallelConfig)
6666
} catch (error) {
67-
const errorMessage = `Parallel distribution resolution failed: ${error instanceof Error ? error.message : String(error)}`
67+
const errorMessage = `Parallel Items did not resolve: ${error instanceof Error ? error.message : String(error)}`
6868
logger.error(errorMessage, {
6969
parallelId,
7070
distribution: parallelConfig.distribution,
@@ -364,7 +364,15 @@ export class ParallelOrchestrator {
364364
}
365365

366366
private resolveDistributionItems(ctx: ExecutionContext, config: SerializedParallel): any[] {
367-
if (config.distribution === undefined || config.distribution === null) {
367+
if (config.parallelType === 'count') {
368+
return []
369+
}
370+
371+
if (
372+
config.distribution === undefined ||
373+
config.distribution === null ||
374+
config.distribution === ''
375+
) {
368376
return []
369377
}
370378
return resolveArrayInput(ctx, config.distribution, this.resolver)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function convertParallelBlockToParallel(
103103
: 'collection'
104104

105105
const distribution =
106-
validatedParallelType === 'collection' ? parallelBlock.data?.collection || '' : ''
106+
validatedParallelType === 'collection' ? parallelBlock.data?.collection || '' : undefined
107107

108108
const count = parallelBlock.data?.count || 5
109109

0 commit comments

Comments
 (0)