@@ -21,7 +21,6 @@ const MAX_WORKFLOW_DEPTH = 10
2121 */
2222export class WorkflowBlockHandler implements BlockHandler {
2323 private serializer = new Serializer ( )
24- private static executionStack = new Set < string > ( )
2524
2625 canHandle ( block : SerializedBlock ) : boolean {
2726 return block . metadata ?. id === BlockType . WORKFLOW
@@ -47,15 +46,6 @@ export class WorkflowBlockHandler implements BlockHandler {
4746 throw new Error ( `Maximum workflow nesting depth of ${ MAX_WORKFLOW_DEPTH } exceeded` )
4847 }
4948
50- // Check for cycles - include block ID to differentiate parallel executions
51- const executionId = `${ context . workflowId } _sub_${ workflowId } _${ block . id } `
52- if ( WorkflowBlockHandler . executionStack . has ( executionId ) ) {
53- throw new Error ( `Cyclic workflow dependency detected: ${ executionId } ` )
54- }
55-
56- // Add current execution to stack
57- WorkflowBlockHandler . executionStack . add ( executionId )
58-
5949 // Load the child workflow from API
6050 const childWorkflow = await this . loadChildWorkflow ( workflowId )
6151
@@ -102,9 +92,6 @@ export class WorkflowBlockHandler implements BlockHandler {
10292 const result = await subExecutor . execute ( workflowId )
10393 const duration = performance . now ( ) - startTime
10494
105- // Remove current execution from stack after completion
106- WorkflowBlockHandler . executionStack . delete ( executionId )
107-
10895 logger . info ( `Child workflow ${ childWorkflowName } completed in ${ Math . round ( duration ) } ms` )
10996
11097 const childTraceSpans = this . captureChildWorkflowLogs ( result , childWorkflowName , context )
@@ -131,8 +118,6 @@ export class WorkflowBlockHandler implements BlockHandler {
131118 } catch ( error : any ) {
132119 logger . error ( `Error executing child workflow ${ workflowId } :` , error )
133120
134- const executionId = `${ context . workflowId } _sub_${ workflowId } _${ block . id } `
135- WorkflowBlockHandler . executionStack . delete ( executionId )
136121 const { workflows } = useWorkflowRegistry . getState ( )
137122 const workflowMetadata = workflows [ workflowId ]
138123 const childWorkflowName = workflowMetadata ?. name || workflowId
0 commit comments