@@ -644,9 +644,30 @@ func (v *commandAttrValidator) validateContinueAsNewWorkflowExecutionAttributes(
644
644
attributes .WorkflowTaskTimeout = timestamp .DurationPtr (timestamp .DurationValue (executionInfo .DefaultWorkflowTaskTimeout ))
645
645
}
646
646
647
+ attributes .WorkflowRunTimeout = timestamp .DurationPtr (
648
+ common .OverrideWorkflowRunTimeout (
649
+ timestamp .DurationValue (attributes .GetWorkflowRunTimeout ()),
650
+ timestamp .DurationValue (executionInfo .GetWorkflowExecutionTimeout ()),
651
+ ),
652
+ )
653
+
654
+ attributes .WorkflowTaskTimeout = timestamp .DurationPtr (
655
+ common .OverrideWorkflowTaskTimeout (
656
+ namespace .String (),
657
+ timestamp .DurationValue (attributes .GetWorkflowTaskTimeout ()),
658
+ timestamp .DurationValue (attributes .GetWorkflowRunTimeout ()),
659
+ v .config .DefaultWorkflowTaskTimeout ,
660
+ ),
661
+ )
662
+
663
+ if err := v .validateWorkflowRetryPolicy (namespace , attributes .RetryPolicy ); err != nil {
664
+ return failedCause , err
665
+ }
666
+
647
667
if err = v .searchAttributesValidator .Validate (attributes .GetSearchAttributes (), namespace .String (), visibilityIndexName ); err != nil {
648
668
return enumspb .WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES , err
649
669
}
670
+
650
671
return enumspb .WORKFLOW_TASK_FAILED_CAUSE_UNSPECIFIED , nil
651
672
}
652
673
@@ -704,7 +725,7 @@ func (v *commandAttrValidator) validateStartChildExecutionAttributes(
704
725
return failedCause , serviceerror .NewInvalidArgument ("Invalid WorkflowTaskTimeout." )
705
726
}
706
727
707
- if err := v .validateWorkflowRetryPolicy (attributes ); err != nil {
728
+ if err := v .validateWorkflowRetryPolicy (namespace . Name ( attributes . GetNamespace ()), attributes . RetryPolicy ); err != nil {
708
729
return failedCause , err
709
730
}
710
731
@@ -790,17 +811,18 @@ func (v *commandAttrValidator) validateActivityRetryPolicy(
790
811
}
791
812
792
813
func (v * commandAttrValidator ) validateWorkflowRetryPolicy (
793
- attributes * commandpb.StartChildWorkflowExecutionCommandAttributes ,
814
+ namespaceName namespace.Name ,
815
+ retryPolicy * commonpb.RetryPolicy ,
794
816
) error {
795
- if attributes . RetryPolicy == nil {
817
+ if retryPolicy == nil {
796
818
// By default, if the user does not explicitly set a retry policy for a Child Workflow, do not perform any retries.
797
819
return nil
798
820
}
799
821
800
822
// Otherwise, for any unset fields on the retry policy, set with defaults
801
- defaultWorkflowRetrySettings := common .FromConfigToDefaultRetrySettings (v .getDefaultWorkflowRetrySettings (attributes . GetNamespace ()))
802
- common .EnsureRetryPolicyDefaults (attributes . RetryPolicy , defaultWorkflowRetrySettings )
803
- return common .ValidateRetryPolicy (attributes . RetryPolicy )
823
+ defaultWorkflowRetrySettings := common .FromConfigToDefaultRetrySettings (v .getDefaultWorkflowRetrySettings (namespaceName . String ()))
824
+ common .EnsureRetryPolicyDefaults (retryPolicy , defaultWorkflowRetrySettings )
825
+ return common .ValidateRetryPolicy (retryPolicy )
804
826
}
805
827
806
828
func (v * commandAttrValidator ) validateCrossNamespaceCall (
0 commit comments