FeatureFlags
in package
Feature flags help to smoothly introduce behavior changes that may affect existing workflows.
Also, there may be experimental features that are in the testing phase.
The flags should be set before the SDK classes are initialized.
Table of Contents
Properties
- $cancelAbandonedChildWorkflows : bool
- When a parent workflow is canceled, it will also cancel all its Child Workflows, including abandoned ones.
- $propagateCancellationToNewScopes : bool
- Make scope cancellation sticky: a nested scope, an await or an onCancel handler registered after the surrounding scope was already cancelled is notified immediately instead of being missed. Set to TRUE to enable this behavior.
- $readOnlyWorkflowCallbacks : bool
- Reject a call that sends a command from a callback that only observes the workflow: a query handler, an update validator, an await condition or a {@see Workflow::sideEffect()} callback.
- $settleAwaitOnFirstSettledCondition : bool
- Unblock multi-condition {@see Workflow::await()} / {@see Workflow::awaitWithTimeout()} on the first settled condition, propagating a rejected promise instead of ignoring it until the timeout. FALSE (default) keeps the old behavior so existing histories stay replay-compatible.
- $throwDestructMemorizedInstanceException : bool
- Throw {@see DestructMemorizedInstanceException} when a Workflow instance is destructed.
- $warnOnActivityMethodWithoutAttribute : bool
- Trigger deprecation warning when activity methods are used without explicit #[ActivityMethod] attribute.
- $warnOnWorkflowUnfinishedHandlers : bool
- Warn about running Signal and Update handlers on Workflow finish.
- $workflowDeferredHandlerStart : bool
- Workflow handler must be called after all signals of the same tick are processed.
Properties
$cancelAbandonedChildWorkflows
When a parent workflow is canceled, it will also cancel all its Child Workflows, including abandoned ones.
public
static bool
$cancelAbandonedChildWorkflows
= true
This behavior is not correct and will be improved by default in the next major SDK version.
To fix the behavior now, set this flag to TRUE. In this case, be aware of the following:
- If you start an abandoned Child Workflow in the main Workflow scope, it may miss the cancellation signal if you await only on the Child Workflow.
- If you start an abandoned Child Workflow in an async scope Workflow::async(), that is later canceled, the Child Workflow will not be affected.
- You still can cancel abandoned Child Workflows manually by calling WorkflowStubInterface::cancel().
Tags
$propagateCancellationToNewScopes
Make scope cancellation sticky: a nested scope, an await or an onCancel handler registered after the surrounding scope was already cancelled is notified immediately instead of being missed. Set to TRUE to enable this behavior.
public
static bool
$propagateCancellationToNewScopes
= false
When FALSE (default), the previous behavior is kept: cancel handlers registered after the cancellation are never invoked.
Tags
$readOnlyWorkflowCallbacks
Reject a call that sends a command from a callback that only observes the workflow: a query handler, an update validator, an await condition or a {@see Workflow::sideEffect()} callback.
public
static bool
$readOnlyWorkflowCallbacks
= true
Such a command does not belong to the workflow's own sequence and breaks replay.
Set to FALSE to keep the previous behavior, where the command is created.
Tags
$settleAwaitOnFirstSettledCondition
Unblock multi-condition {@see Workflow::await()} / {@see Workflow::awaitWithTimeout()} on the first settled condition, propagating a rejected promise instead of ignoring it until the timeout. FALSE (default) keeps the old behavior so existing histories stay replay-compatible.
public
static bool
$settleAwaitOnFirstSettledCondition
= false
Tags
$throwDestructMemorizedInstanceException
Throw {@see DestructMemorizedInstanceException} when a Workflow instance is destructed.
public
static bool
$throwDestructMemorizedInstanceException
= true
Tags
$warnOnActivityMethodWithoutAttribute
Trigger deprecation warning when activity methods are used without explicit #[ActivityMethod] attribute.
public
static bool
$warnOnActivityMethodWithoutAttribute
= true
Tags
$warnOnWorkflowUnfinishedHandlers
Warn about running Signal and Update handlers on Workflow finish.
public
static bool
$warnOnWorkflowUnfinishedHandlers
= true
It uses Workflow::getLogger() to output a warning message.
Tags
$workflowDeferredHandlerStart
Workflow handler must be called after all signals of the same tick are processed.
public
static bool
$workflowDeferredHandlerStart
= false
Set to TRUE to enable this behavior.