fix(workflow-block): remove process specific circular dependency check#1293
fix(workflow-block): remove process specific circular dependency check#1293icecrasher321 merged 2 commits intostagingfrom
Conversation
There was a problem hiding this comment.
Greptile Summary
This PR removes process-specific circular dependency detection from the workflow block handler to eliminate arbitrary execution failures. The change removes a static executionStack Set that tracked composite execution IDs (format: ${context.workflowId}_sub_${workflowId}_${block.id}) to prevent cyclic workflow dependencies.
The previous implementation was causing false positives where legitimate parallel or sequential workflow executions were incorrectly flagged as cycles. The execution ID format was too restrictive and didn't account for valid scenarios where the same child workflow might be called multiple times within different execution contexts or parallel branches.
The system now relies exclusively on the existing MAX_WORKFLOW_DEPTH limit (10 levels) and execution timeouts as protection against infinite recursion. This change simplifies the codebase by removing complex cycle detection logic while maintaining essential safeguards through depth-based protection that works more reliably in concurrent execution environments.
The corresponding test for cyclic dependency detection has been removed from the test suite, with comments indicating the shift to relying on depth limits and timeout mechanisms. The depth limit test remains to verify the alternative protection mechanism still functions correctly.
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it removes problematic logic causing false positives
- Score reflects that while explicit cycle detection is removed, robust depth limits and timeouts provide adequate protection
- Pay close attention to workflow-handler.ts to ensure the depth limit mechanism is sufficient for preventing infinite recursion
2 files reviewed, no comments
simstudioai#1293) * fix(workflow-block): remove process specific circular dep check * remove comments
Summary
Process specific execution id stack doesn't make sense, and leads to arbitrary failures.
Type of Change
Testing
No functional change
Checklist