{"record":{"id":"7e96d2272d9fe1c9","repo":"temporalio/temporal","slug":"callback-with-unspecified-state","errorCode":null,"errorMessage":"callback with UNSPECIFIED state","messagePattern":"callback with UNSPECIFIED state","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"service/history/api/describeworkflow/api.go","lineNumber":46,"sourceCode":"\t\"go.temporal.io/server/common/log\"\n\t\"go.temporal.io/server/common/log/tag\"\n\t\"go.temporal.io/server/common/metrics\"\n\t\"go.temporal.io/server/common/namespace\"\n\t\"go.temporal.io/server/common/persistence/visibility/manager\"\n\t\"go.temporal.io/server/components/callbacks\"\n\t\"go.temporal.io/server/components/nexusoperations\"\n\t\"go.temporal.io/server/service/history/api\"\n\t\"go.temporal.io/server/service/history/circuitbreakerpool\"\n\t\"go.temporal.io/server/service/history/hsm\"\n\thistoryi \"go.temporal.io/server/service/history/interfaces\"\n\t\"go.temporal.io/server/service/history/tasks\"\n\t\"go.temporal.io/server/service/history/workflow\"\n\t\"google.golang.org/protobuf/types/known/durationpb\"\n\t\"google.golang.org/protobuf/types/known/timestamppb\"\n)\n\nvar (\n\terrCallbackStateUnspecified       = errors.New(\"callback with UNSPECIFIED state\")\n\terrNexusOperationStateUnspecified = errors.New(\"Nexus operation with UNSPECIFIED state\")\n)\n\nfunc clonePayloadMap(source map[string]*commonpb.Payload) map[string]*commonpb.Payload {\n\ttarget := make(map[string]*commonpb.Payload, len(source))\n\tfor k, v := range source {\n\t\tmetadata := make(map[string][]byte, len(v.GetMetadata()))\n\t\tmaps.Copy(metadata, v.GetMetadata())\n\t\ttarget[k] = &commonpb.Payload{\n\t\t\tMetadata: metadata,\n\t\t\tData:     v.GetData(),\n\t\t}\n\t}\n\treturn target\n}\n\nfunc Invoke(\n\tctx context.Context,","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/api/describeworkflow/api.go#L28-L64","documentation":"errCallbackStateUnspecified is returned by buildCallbackInfoFromHSM when a callback's HSM state machine is in a state that maps to UNSPECIFIED in the API's CallbackInfo state enum. DescribeWorkflowExecution must report a concrete callback state; UNSPECIFIED indicates the state machine is in a state the API layer cannot represent (typically an internal/terminal bookkeeping state).","triggerScenarios":"DescribeWorkflowExecution on a workflow with a callback (e.g. a Nexus operation callback) whose HSM state does not map to a defined enumspb.CallbackState - e.g. state still initializing or in an internal-only state.","commonSituations":"Describing a workflow while a callback is being created/cleaned up, server version skew where new HSM states exist but the enum mapping is incomplete, or API clients on older SDKs seeing newer state mappings.","solutions":["Retry the describe after the callback state machine settles into a concrete state","Ensure the server version maps all current HSM callback states to defined CallbackState values (upgrade if needed)","If persistent on a current version, capture the workflow ID and HSM state and report to Temporal - it indicates a missing state mapping"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"info, err := describeWorkflowExecution(ctx, req)\nif errors.Is(err, errCallbackStateUnspecified) { time.Sleep(backoff); info, err = describeWorkflowExecution(ctx, req) }","preventionTips":["Avoid describing workflows immediately while callbacks are being set up or cleaned up","Keep server and API versions aligned so callback HSM states map to defined enum values","Monitor for persistent occurrences and report as a missing state-mapping bug"],"tags":["callback","describe-workflow","hsm","state-mapping"],"backgroundTag":"callback-state-unspecified","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}