Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Description

Fixed routing issue with workflow block, added tests

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested manually & added executor tests & additional documentation.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Workflow doesn't execute when not chosen by the router:
Screenshot 2025-07-21 at 11 26 17 AM

Does execute when chosen:
Screenshot 2025-07-21 at 11 26 53 AM

@vercel
Copy link

vercel bot commented Jul 21, 2025

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

Name Status Preview Comments Updated (UTC)
sim ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 21, 2025 7:14pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
docs ⬜️ Skipped (Inspect) Jul 21, 2025 7:14pm

@delve-auditor
Copy link

delve-auditor bot commented Jul 21, 2025

No security or compliance issues detected. Reviewed everything up to 576a44d.

Security Overview
  • 🔎 Scanned files: 23 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► console-logger.ts
    Replace console statements with logger
► route.ts
    Update logging to use logger class
► routing.ts
    Refine routing behavior and path tracking
► routing.test.ts
    Add tests for routing execution
Refactor ► multi-input-routing.test.ts
    Add tests for multi-input scenarios
► router-workflow-execution.test.ts
    Add tests for router workflow execution

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

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 routing issue in the workflow execution engine where workflow blocks would incorrectly execute even when not selected by router blocks. The core changes include:

  1. Recategorizing WORKFLOW blocks as FLOW_CONTROL instead of REGULAR_BLOCK to ensure proper routing awareness
  2. Fixing dependency checking logic to properly handle unselected paths
  3. Adding comprehensive test coverage for multi-input routing and workflow execution scenarios

The changes affect the executor's core routing system, particularly in how it handles path selection and dependencies. When a router or condition block makes a selection, blocks on unselected paths are now correctly prevented from executing, fixing the workflow routing behavior shown in the PR screenshots.

Confidence score: 5/5

  1. This PR is very safe to merge - it fixes a clear bug with solid test coverage
  2. The changes are well-tested with both unit tests and manual verification, and the fixes are focused on correcting specific incorrect behaviors rather than introducing new patterns
  3. Key files needing attention:
    • apps/sim/executor/index.ts (core dependency logic changes)
    • apps/sim/executor/routing/routing.ts (block categorization)
    • apps/sim/executor/tests/multi-input-routing.test.ts (new test coverage)

7 files reviewed, 2 comments

Edit Code Review Bot Settings | Greptile

@vercel vercel bot temporarily deployed to Preview – docs July 21, 2025 19:08 Inactive
@waleedlatif1 waleedlatif1 merged commit 7f0f902 into staging Jul 21, 2025
4 of 6 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/router branch July 21, 2025 19:13
arenadeveloper02 pushed a commit to arenadeveloper02/p2-sim that referenced this pull request Sep 19, 2025
…mstudioai#739)

* fixed routing issue with workflow block, added tests

* add new dmeo

* change console to logger

* new demo

* changed all console to logger
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.

2 participants