{"record":{"id":"4b113e23957db92b","repo":"temporalio/temporal","slug":"invalid-cronschedule-on-startchildworkflowexecutio","errorCode":null,"errorMessage":"invalid CronSchedule on StartChildWorkflowExecutionCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s","messagePattern":"invalid CronSchedule on StartChildWorkflowExecutionCommand: %w\\. WorkflowId=(.+?) WorkflowType=(.+?) Namespace=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/history/api/command_attr_validator.go","lineNumber":526,"sourceCode":"\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,\n\t\t}\n\t}\n\tif err := tqid.NormalizeAndValidateUserDefined(\n\t\tattributes.TaskQueue, parentInfo.TaskQueue, parentInfo.TaskQueue, v.maxIDLengthLimit); err != nil {","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/api/command_attr_validator.go#L508-L544","documentation":"The StartChildWorkflowExecution command's CronSchedule fails backoff.ValidateSchedule (not a valid cron expression per the server's parser). The workflow task fails with this wrapped message.","triggerScenarios":"ChildWorkflowOptions.CronSchedule set to a malformed cron string (wrong field count, invalid characters, out-of-range values) when starting a child workflow.","commonSituations":"Using 6-field Quartz-style cron with seconds where the server expects 5-field (or vice versa); typos like */0; config-provided cron strings never validated client-side.","solutions":["Test the cron string with a standard 5-field cron parser before use","Verify field count and ranges (minute 0-59, hour 0-23, etc.)","Use @-macros (@daily, @hourly) where supported"],"exampleFix":"// before\nopts := workflow.ChildWorkflowOptions{CronSchedule: \"0 25 * *\"}\n// after\nopts := workflow.ChildWorkflowOptions{CronSchedule: \"0 25 * * *\"}","handlingStrategy":"validation","validationCode":"if err := backoff.ValidateSchedule(opts.CronSchedule); err != nil { return fmt.Errorf(\"invalid cron: %w\", err) }","typeGuard":"func hasCron(o workflow.ChildWorkflowOptions) (string, bool) { return o.CronSchedule, o.CronSchedule != \"\" }","tryCatchPattern":"inspect StartChildWorkflowExecutionCommandFailed event failure details in parent workflow history; correct the cron string and restart","preventionTips":["Validate cron strings with a 5-field parser at config load time","Prefer @-macros over hand-written expressions","Add unit tests covering every cron string shipped in config"],"tags":["cron","childworkflow","validation","history"],"backgroundTag":"invalid-cron-expression","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}