fix(subflows): added change detection for parallels, updated deploy and status schemas to match parallel/loop#956
Conversation
…nd status schemas to match parallel/loop
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
There was a problem hiding this comment.
Greptile Summary
This PR fixes a critical gap in the workflow change detection system and ensures schema consistency across the codebase. The main changes involve three interconnected files:
Change Detection Enhancement: The core fix adds parallel comparison logic to the hasWorkflowChanged function in apps/sim/lib/workflows/utils.ts. Previously, this function only compared edges, blocks, and loops when determining if a workflow had changed, but it was missing parallel execution blocks entirely. The new section 5 follows the exact same pattern as the existing loop comparison (section 4), comparing parallel IDs and their normalized configurations to detect any changes.
Schema Standardization: The deploy and status API routes (apps/sim/app/api/workflows/[id]/deploy/route.ts and apps/sim/app/api/workflows/[id]/status/route.ts) have been updated to use consistent field names for both loops and parallels. The changes include:
- Loops:
iterationCount→iterations,iterationType→loopType,collection→forEachItems - Parallels:
parallelCount→count, addeddistributionandparallelTypefields, removedcollection - Both subflow types now include explicit
idfields
These schema updates ensure that the workflow state objects created during deployment and status checks use the same structure that the change detection function expects. This alignment is crucial for the hasWorkflowChanged function to accurately compare current and deployed states, preventing false positives or missed changes during redeployment checks.
The changes integrate seamlessly with the existing workflow execution system, maintaining the same patterns and conventions used throughout the codebase for handling subflow configurations.
Confidence score: 5/5
- This PR is extremely safe to merge with minimal risk of production issues
- Score reflects straightforward bug fixes with consistent patterns and comprehensive schema alignment
- No files require special attention as all changes follow established codebase conventions
3 files reviewed, no comments
…nd status schemas to match parallel/loop (simstudioai#956)
Summary
added change detection for parallels, updated deploy and status schemas to match parallel/loop
Type of Change
Testing
Tested manually
Checklist