{"record":{"id":"d429069db9a5b74b","repo":"temporalio/temporal","slug":"failed-to-execute-task-w","errorCode":null,"errorMessage":"failed to execute task: %w","messagePattern":"failed to execute task: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/history/timer_queue_task_executor_base.go","lineNumber":254,"sourceCode":"\t\tWorkflowKey:     ms.GetWorkflowKey(),\n\t\tStateMachineRef: timer.Ref,\n\t\tValidate:        smt.Validate,\n\t}\n\t// TODO(bergundy): Duplicated this logic from the Access method. We specify write access here because\n\t// validateNotZombieWorkflow only blocks write access to zombie workflows.\n\tif err := t.validateNotZombieWorkflow(ms, hsm.AccessWrite); err != nil {\n\t\treturn err\n\t}\n\tif err := t.validateStateMachineRef(ctx, workflowContext, ms, ref, false); err != nil {\n\t\treturn err\n\t}\n\tnode, err := ms.HSM().Child(ref.StateMachinePath())\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := execute(node, smt); err != nil {\n\t\treturn fmt.Errorf(\"failed to execute task: %w\", err)\n\t}\n\treturn nil\n}\n\n// executeChasmPureTimers walks a CHASM tree for expired pure task timers,\n// executes them, and returns a count of timers processed.\nfunc (t *timerQueueTaskExecutorBase) executeChasmPureTimers(\n\tms historyi.MutableState,\n\ttask *tasks.ChasmTaskPure,\n\tcallback func(node chasm.NodePureTask, taskAttributes chasm.TaskAttributes, task any) (bool, error),\n) error {\n\t// Because CHASM timers can target closed workflows, we need to specifically\n\t// exclude zombie workflows, instead of merely checking that the workflow is\n\t// running.\n\tif ms.GetExecutionState().State == enumsspb.WORKFLOW_EXECUTION_STATE_ZOMBIE {\n\t\treturn consts.ErrWorkflowZombie\n\t}\n","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/service/history/timer_queue_task_executor_base.go#L236-L272","documentation":"Error \"failed to execute task: %w\" thrown in temporalio/temporal.","triggerScenarios":"Thrown at service/history/timer_queue_task_executor_base.go:254 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}