Skip to content

Conversation

@roxblnfk
Copy link
Collaborator

@roxblnfk roxblnfk commented Aug 25, 2025

What was changed

  • Added new feature flag FeatureFlags::$cancelAbandonedChildWorkflows in src/Worker/FeatureFlags.php
  • Modified ChildWorkflowStub.php to check the feature flag when determining if child workflows should be cancellable
  • Updated test configuration in RuntimeBuilder.php to use the new feature flag
  • Added comprehensive test coverage in CancelAbandonTest.php with multiple scenarios

Why?

Previously, when a parent workflow was canceled, all child workflows would be canceled, including those with ParentClosePolicy::Abandon. This behavior was incorrect according to Temporal semantics - abandoned child workflows should continue running independently when their parent is canceled.

The feature flag provides:

  1. Backward compatibility - defaults to true to maintain existing behavior
  2. Gradual migration - allows users to opt into the correct behavior by setting the flag to false
  3. Future-proofing - enables changing the default behavior in a future major version

This change ensures that abandoned child workflows behave correctly while allowing existing workflows to continue functioning without breaking changes.

Checklist

  1. Closes [Bug] Abandoned Child Workflows Cancellation policy #634
  2. How was this tested:
  • added acceptance tests

@roxblnfk roxblnfk requested a review from wolfy-j as a code owner August 25, 2025 20:34
@vercel
Copy link

vercel bot commented Aug 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
php Ready Ready Preview Comment Aug 26, 2025 6:56am

@roxblnfk roxblnfk merged commit 15d61fb into master Aug 26, 2025
159 of 166 checks passed
@roxblnfk roxblnfk deleted the abandoned-children-close branch August 26, 2025 13:11
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.

[Bug] Abandoned Child Workflows Cancellation policy

3 participants