{"record":{"id":"46ee4aa4a0a50fd2","repo":"temporalio/temporal","slug":"invalid-searchattributes-on-startchildworkflowcomm","errorCode":null,"errorMessage":"invalid SearchAttributes on StartChildWorkflowCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s","messagePattern":"invalid SearchAttributes on StartChildWorkflowCommand: %w\\. WorkflowId=(.+?) WorkflowType=(.+?) Namespace=(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/history/api/command_attr_validator.go","lineNumber":530,"sourceCode":"\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 {\n\t\treturn failedCause, fmt.Errorf(\"invalid TaskQueue on StartChildWorkflowExecutionCommand: %w. WorkflowId=%s WorkflowType=%s Namespace=%s TaskQueue=%s\", err, wfID, wfType, ns, attributes.TaskQueue)\n\t}\n\n\t// workflow execution timeout is left as is","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/api/command_attr_validator.go#L512-L548","documentation":"The StartChildWorkflowExecution command's SearchAttributes fail validation against the target namespace. Fails with WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES and a message that notably says 'StartChildWorkflowCommand' (legacy wording).","triggerScenarios":"ChildWorkflowOptions carrying invalid search attributes (unregistered keys, wrong types, deprecated SearchAttributes map) evaluated against targetNamespace.","commonSituations":"Attributes registered in the parent namespace but not the child/target namespace; mixing deprecated SearchAttributes with TypedSearchAttributes; key typos.","solutions":["Register the search attributes in the target namespace","Use TypedSearchAttributes typed keys","Confirm key/value type pairing matches namespace schema"],"exampleFix":"// before\nopts := workflow.ChildWorkflowOptions{TypedSearchAttributes: attrsForParentNamespace}\n// after\nopts := workflow.ChildWorkflowOptions{TypedSearchAttributes: attributesValidInTargetNamespace}","handlingStrategy":"validation","validationCode":"for k, v := range searchAttrs { if !registeredInNamespace(targetNS, k) { return fmt.Errorf(\"key %s not registered in %s\", k, targetNS) } }","typeGuard":"func asTypedSearchAttributes(o workflow.ChildWorkflowOptions) (temporal.SearchAttributes, bool) { return o.TypedSearchAttributes, !o.TypedSearchAttributes.IsEmpty() }","tryCatchPattern":"catch WORKFLOW_TASK_FAILED_CAUSE_BAD_SEARCH_ATTRIBUTES in history event details; register missing keys in the target namespace, then retry the child start","preventionTips":["Mirror search attribute registration across all namespaces you use","Prefer typed search attributes over raw maps","Lint key names for typos before deployment"],"tags":["searchattributes","childworkflow","validation","history"],"backgroundTag":"invalid-search-attributes","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}