{"record":{"id":"621d358a37c74205","repo":"temporalio/temporal","slug":"invalid-workflowretrypolicy-on-startchildworkflowe","errorCode":null,"errorMessage":"invalid WorkflowRetryPolicy on StartChildWorkflowExecutionCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s","messagePattern":"invalid WorkflowRetryPolicy on StartChildWorkflowExecutionCommand: %w\\. WorkflowId=(.+?) WorkflowType=(.+?) Namespace=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/history/api/command_attr_validator.go","lineNumber":522,"sourceCode":"\n\tif len(wfType) > v.maxIDLengthLimit {\n\t\treturn failedCause, serviceerror.NewInvalidArgumentf(\"WorkflowType on StartChildWorkflowExecutionCommand exceeds length limit. WorkflowId=%s WorkflowType=%s Length=%d Limit=%d Namespace=%s\", wfID, wfType, len(wfType), v.maxIDLengthLimit, ns)\n\t}\n\n\tif err := timestamp.ValidateAndCapProtoDuration(attributes.GetWorkflowExecutionTimeout()); err != nil {\n\t\treturn failedCause, serviceerror.NewInvalidArgumentf(\"Invalid WorkflowExecutionTimeout on StartChildWorkflowExecutionCommand: %v. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := timestamp.ValidateAndCapProtoDuration(attributes.GetWorkflowRunTimeout()); err != nil {\n\t\treturn failedCause, serviceerror.NewInvalidArgumentf(\"Invalid WorkflowRunTimeout on StartChildWorkflowExecutionCommand: %v. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := timestamp.ValidateAndCapProtoDuration(attributes.GetWorkflowTaskTimeout()); err != nil {\n\t\treturn failedCause, serviceerror.NewInvalidArgumentf(\"Invalid WorkflowTaskTimeout on StartChildWorkflowExecutionCommand: %v. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := v.validateWorkflowRetryPolicy(namespace.Name(attributes.GetNamespace()), attributes.RetryPolicy); err != nil {\n\t\treturn failedCause, fmt.Errorf(\"invalid WorkflowRetryPolicy on StartChildWorkflowExecutionCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := backoff.ValidateSchedule(attributes.GetCronSchedule()); err != nil {\n\t\treturn failedCause, fmt.Errorf(\"invalid CronSchedule on StartChildWorkflowExecutionCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := v.searchAttributesValidator.Validate(attributes.GetSearchAttributes(), targetNamespace.String()); err != nil {\n\t\treturn enumspb.WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES, fmt.Errorf(\"invalid SearchAttributes on StartChildWorkflowCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s\", err, wfID, wfType, ns)\n\t}\n\n\tif err := priorities.Validate(attributes.Priority); err != nil {\n\t\treturn failedCause, err\n\t}\n\n\t// Inherit taskqueue from parent workflow execution if not provided on command\n\tif attributes.TaskQueue == nil {\n\t\tattributes.TaskQueue = &taskqueuepb.TaskQueue{\n\t\t\tKind: enumspb.TASK_QUEUE_KIND_NORMAL,","sourceCodeStart":504,"sourceCodeEnd":540,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/api/command_attr_validator.go#L504-L540","documentation":"ValidateStartChildExecutionAttributes rejects a StartChildWorkflowExecution command whose RetryPolicy fails validation in the child namespace context. The workflow task fails with this wrapped message identifying WorkflowId/Type/Namespace.","triggerScenarios":"ChildWorkflowOptions with an invalid RetryPolicy (non-positive InitialInterval, BackoffCoefficient < 1, MaximumInterval < InitialInterval) when the parent issues the StartChildWorkflowExecution command.","commonSituations":"Unit mistakes in retry intervals (ms/s); serializing a zero-value struct as if it were a full policy; cross-namespace children inheriting policies that don't validate in the target namespace.","solutions":["Fix RetryPolicy values: InitialInterval > 0, coefficient >= 1, MaximumInterval >= InitialInterval","Use SDK default retry policy helpers","Validate the policy before starting the child workflow"],"exampleFix":"// before\nopts := workflow.ChildWorkflowOptions{RetryPolicy: &workflowsvc.RetryPolicy{BackoffCoefficient: 0.5}}\n// after\nopts := workflow.ChildWorkflowOptions{RetryPolicy: &workflowsvc.RetryPolicy{InitialInterval: durationpb.New(time.Second), BackoffCoefficient: 2}}","handlingStrategy":"validation","validationCode":"func validChildRetry(p *workflowsvc.RetryPolicy) bool { return p == nil || (p.GetInitialInterval().AsDuration() > 0 && p.GetBackoffCoefficient() >= 1) }","typeGuard":"func retryPolicyFromOptions(o workflow.ChildWorkflowOptions) *workflowsvc.RetryPolicy { return o.RetryPolicy }","tryCatchPattern":"child workflow start fails as workflow task failure; check child workflow history for the StartChildWorkflowExecutionCommandFailed event","preventionTips":["Sanity-check all intervals before setting RetryPolicy","Use retry.BuildDefaultOutbox-style SDK defaults where available","Test policies in integration tests"],"tags":["retrypolicy","childworkflow","validation","history"],"backgroundTag":"invalid-retry-policy","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}