@@ -707,6 +707,50 @@ func Test_Executor(t *testing.T) {
707707 require .Equal (t , goRoutines , runtime .NumGoroutine ())
708708 },
709709 },
710+ {
711+ name : "WorkflowExecutionContinuedAsNew event handled without error" ,
712+ f : func (t * testing.T , r * registry.Registry , e * executor , i * core.WorkflowInstance , hp * testHistoryProvider ) {
713+ // Simple workflow that completes
714+ wf := func (ctx sync.Context ) error {
715+ return nil
716+ }
717+
718+ r .RegisterWorkflow (wf )
719+
720+ // Create a task with WorkflowExecutionContinuedAsNew event
721+ result , _ := converter .DefaultConverter .To (42 )
722+ task := & backend.WorkflowTask {
723+ ID : "taskID" ,
724+ WorkflowInstance : core .NewWorkflowInstance ("instanceID" , "executionID" ),
725+ Metadata : & metadata.WorkflowMetadata {},
726+ NewEvents : []* history.Event {
727+ history .NewHistoryEvent (
728+ 1 ,
729+ time .Now (),
730+ history .EventType_WorkflowExecutionStarted ,
731+ & history.ExecutionStartedAttributes {
732+ Name : fn .Name (wf ),
733+ Inputs : []payload.Payload {},
734+ },
735+ ),
736+ history .NewHistoryEvent (
737+ 2 ,
738+ time .Now (),
739+ history .EventType_WorkflowExecutionContinuedAsNew ,
740+ & history.ExecutionContinuedAsNewAttributes {
741+ Result : result ,
742+ ContinuedExecutionID : "continued-execution-id" ,
743+ },
744+ ),
745+ },
746+ }
747+
748+ // Execute the task - should not return an error
749+ _ , err := e .ExecuteTask (context .Background (), task )
750+ require .NoError (t , err )
751+ require .Nil (t , e .workflow .err )
752+ },
753+ },
710754 }
711755
712756 for _ , tt := range tests {
0 commit comments