256
}
257
258
>
bufferedStarts := make([]*schedulespb.BufferedStart, len(runningWorkflows))
migration.go
259
>
for i, wf := range runningWorkflows {
260
>
bufferedStarts[i] = &schedulespb.BufferedStart{
261
>
NominalTime: timestamppb.New(migrationTime),
262
>
ActualTime: timestamppb.New(migrationTime),
263
>
StartTime: timestamppb.New(migrationTime),
264
>
WorkflowId: wf.WorkflowId,
265
>
RunId: wf.RunId,
266
>
// RequestId will be used with AttachRequestID to register Nexus
267
>
// callbacks for tracking workflow completion after migration.
268
>
// Include the RunId in the tag to ensure each running workflow
269
>
// gets a unique RequestId (important for ALLOW_ALL overlap
270
>
// policy where multiple workflows may be running concurrently).
271
>
RequestId: schedulescommon.GenerateRequestID(
272
>
namespaceID,
273
>
scheduleID,
274
>
conflictToken,
275
>
"migrated-running-"+wf.RunId,
276
>
migrationTime,
277
>
migrationTime,
278
>
),
279
>
Attempt: 1,
280
>
Completed: nil,
281
>
// Migrated running workflows must have a Nexus callback attached once the
282
>
// migrated schedule target has been created.
283
>
HasCallback: false,
284
>
}
285
>
}
286
288
}
289