260
continueAsNew := NewHistoryEventVertex(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW.String())
261
continueAsNew.SetDataFunc(func(input ...any) any {
263
>
eventID := lastEvent.GetEventId() + 1
264
>
version := input[2].(int64)
265
>
historyEvent := getDefaultHistoryEvent(eventID, version)
266
>
historyEvent.EventType = enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW
267
>
historyEvent.Attributes = &historypb.HistoryEvent_WorkflowExecutionContinuedAsNewEventAttributes{WorkflowExecutionContinuedAsNewEventAttributes: &historypb.WorkflowExecutionContinuedAsNewEventAttributes{
268
>
NewExecutionRunId: uuid.NewString(),
269
>
WorkflowType: &commonpb.WorkflowType{
270
>
Name: workflowType,
271
>
},
272
>
TaskQueue: &taskqueuepb.TaskQueue{
273
>
Name: taskQueue,
274
>
Kind: enumspb.TASK_QUEUE_KIND_NORMAL,
275
>
},
276
>
WorkflowRunTimeout: durationpb.New(timeout),
277
>
WorkflowTaskTimeout: durationpb.New(timeout),
278
>
WorkflowTaskCompletedEventId: eventID - 1,
279
>
Initiator: enumspb.CONTINUE_AS_NEW_INITIATOR_WORKFLOW,
280
>
}}
281
>
return historyEvent
282
>
})
283
workflowFail := NewHistoryEventVertex(enumspb.EVENT_TYPE_WORKFLOW_EXECUTION_FAILED.String())
284
workflowFail.SetDataFunc(func(input ...any) any {