@@ -69,6 +69,7 @@ internal class WorkflowInstance : TaskScheduler, IWorkflowInstance, IWorkflowCon
6969 private readonly Action < WorkflowInstance > onTaskStarting ;
7070 private readonly Action < WorkflowInstance , Exception ? > onTaskCompleted ;
7171 private readonly IReadOnlyCollection < Type > ? workerLevelFailureExceptionTypes ;
72+ private readonly bool disableEagerActivityExecution ;
7273 private readonly Handlers inProgressHandlers = new ( ) ;
7374 private WorkflowActivationCompletion ? completion ;
7475 // Will be set to null after last use (i.e. when workflow actually started)
@@ -190,6 +191,7 @@ public WorkflowInstance(WorkflowInstanceDetails details)
190191 Random = new ( details . Start . RandomnessSeed ) ;
191192 TracingEventsEnabled = ! details . DisableTracingEvents ;
192193 workerLevelFailureExceptionTypes = details . WorkerLevelFailureExceptionTypes ;
194+ disableEagerActivityExecution = details . DisableEagerActivityExecution ;
193195 }
194196
195197 /// <summary>
@@ -1756,6 +1758,7 @@ public override Task<TResult> ScheduleActivityAsync<TResult>(
17561758 Arguments = { instance . PayloadConverter . ToPayloads ( input . Args ) } ,
17571759 RetryPolicy = input . Options . RetryPolicy ? . ToProto ( ) ,
17581760 CancellationType = ( Bridge . Api . WorkflowCommands . ActivityCancellationType ) input . Options . CancellationType ,
1761+ DoNotEagerlyExecute = instance . disableEagerActivityExecution || input . Options . DisableEagerActivityExecution ,
17591762 } ;
17601763 if ( input . Headers is IDictionary < string , Payload > headers )
17611764 {
0 commit comments