{"record":{"id":"01ebe43e8ebd6a84","repo":"temporalio/temporal","slug":"unknown-workflow-close-status-s","errorCode":null,"errorMessage":"unknown workflow close status: %s","messagePattern":"unknown workflow close status: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/archiver/filestore/query_parser.go","lineNumber":222,"sourceCode":"}\n\nfunc convertStatusStr(statusStr string) (enumspb.WorkflowExecutionStatus, error) {\n\tstatusStr = strings.ToLower(strings.TrimSpace(statusStr))\n\tswitch statusStr {\n\tcase \"completed\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED, nil\n\tcase \"failed\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_FAILED)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_FAILED, nil\n\tcase \"canceled\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_CANCELED)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_CANCELED, nil\n\tcase \"terminated\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_TERMINATED, nil\n\tcase \"continuedasnew\", \"continued_as_new\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_CONTINUED_AS_NEW, nil\n\tcase \"timedout\", \"timed_out\", convert.Int32ToString(int32(enumspb.WORKFLOW_EXECUTION_STATUS_TIMED_OUT)):\n\t\treturn enumspb.WORKFLOW_EXECUTION_STATUS_TIMED_OUT, nil\n\tdefault:\n\t\treturn 0, fmt.Errorf(\"unknown workflow close status: %s\", statusStr)\n\t}\n}\n","sourceCodeStart":204,"sourceCodeEnd":225,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/filestore/query_parser.go#L204-L225","documentation":"convertStatusStr in the filestore visibility query parser translates a query's status literal (e.g. CloseTime='completed' or a numeric enum string) into an enumspb.WorkflowExecutionStatus. If the string matches none of the known names or numeric codes, it returns 'unknown workflow close status: %s'. The parser is case-insensitive and trims whitespace before matching.","triggerScenarios":"Running a visibility query against the file archiver with a CloseStatus/Status comparison value that is not one of completed, failed, canceled, terminated, continued_as_new (also continuedasnew), timed_out (also timedout), or their numeric enum equivalents (e.g. status='running' or a misspelled value).","commonSituations":"Users querying open workflows by close status (open is not a close status), typos like 'compleated', or using status names not supported by the file-based archiver.","solutions":["Use a supported close status literal: completed, failed, canceled, terminated, continued_as_new, or timed_out (case-insensitive)","Use the numeric enum value as a string (e.g. CloseStatus='1' for completed)","Remove the status filter if querying workflows that are not yet closed — the file archiver only stores closed executions"],"exampleFix":"// before\n`CloseTime > 0 and CloseStatus = \"running\"`\n// after\n`CloseTime > 0 and CloseStatus = \"completed\"`","handlingStrategy":"validation","validationCode":"allowed := map[string]bool{\"completed\":true,\"failed\":true,\"canceled\":true,\"terminated\":true,\"continued_as_new\":true,\"timed_out\":true}\nif !allowed[strings.ToLower(status)] { return fmt.Errorf(\"unsupported close status %q for file archiver query\", status) }","typeGuard":"func isKnownCloseStatus(s string) bool {\n  switch strings.ToLower(strings.TrimSpace(s)) {\n  case \"completed\", \"failed\", \"canceled\", \"terminated\", \"continuedasnew\", \"continued_as_new\", \"timedout\", \"timed_out\":\n    return true\n  }\n  return false\n}","tryCatchPattern":"resp, err := client.ArchiveQuery(ctx, req)\nif err != nil {\n  if strings.Contains(err.Error(), \"unknown workflow close status\") {\n    return nil, fmt.Errorf(\"bad status filter in query %q: %w\", req.Query, err)\n  }\n  return nil, err\n}","preventionTips":["Only filter on close statuses supported by the file archiver","Remember the file archiver only holds closed executions — no 'running' status","Build queries programmatically from an enum list rather than free-text","Trim/lowercase user-supplied status strings before sending"],"tags":["go","archiver","visibility","query-parser"],"backgroundTag":"invalid-query-filter-value","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}