Skip to content

fix(subflows): added change detection for parallels, updated deploy and status schemas to match parallel/loop#956

Merged
waleedlatif1 merged 1 commit intostagingfrom
fix/parallel
Aug 14, 2025
Merged

fix(subflows): added change detection for parallels, updated deploy and status schemas to match parallel/loop#956
waleedlatif1 merged 1 commit intostagingfrom
fix/parallel

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

added change detection for parallels, updated deploy and status schemas to match parallel/loop

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Project Deployment Preview Comments Updated (UTC)
sim Ready Preview Comment Aug 14, 2025 4:17am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs ⬜️ Skipped Aug 14, 2025 4:17am

@waleedlatif1 waleedlatif1 merged commit da04ea0 into staging Aug 14, 2025
4 checks passed
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: iterationCountiterations, iterationTypeloopType, collectionforEachItems
  • Parallels: parallelCountcount, added distribution and parallelType fields, removed collection
  • Both subflow types now include explicit id fields

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

Edit Code Review Bot Settings | Greptile

@waleedlatif1 waleedlatif1 deleted the fix/parallel branch August 15, 2025 17:03
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant