I have a workflow and activity setup as following
type Rollback struct {
Product string
RequestID string
}
type RollbackList []Rollback
type ActivityRequest struct {
Name string
RollbackList RollbackList
}
func (w Workflow) RollbackWorkflow(ctx workflow.Context, rollbackList RollbackList) error {
ao := workflow.ActivityOptions{
StartToCloseTimeout: defaultActivityTimeout,
}
ctx = workflow.WithActivityOptions(ctx, ao)
logger := workflow.GetLogger(ctx)
logger.Info("Starting activity")
for i := range rollbackList {
rollbackList[i].RequestID = uuid.New().String()
}
activityRequest := ActivityRequest{
Name: "rollback",
RollbackList: rollbackList,
}
err := workflow.ExecuteActivity(ctx, DeleteProducts, activityRequest).Get(ctx, nil)
if err != nil {
return err
}
logger.Info("Finished activity")
return nil
}
type Activity struct {
productReportsClient productReports.Client
}
func (a Activity) DeleteProducts(ctx context.Context, req ActivityRequest) (string, error) {
for _, rollback := range req.RollbackList {
_, err := a.productReportsClient.DeleteWithContext(
invocationcontext.NewContext(ctx, invocationcontext.FromActivityContext(ctx)),
rollback.Product,
&productReports.DeleteParams{RequestId: &rollback.RequestID},
)
if err != nil {
return "", err
}
}
return "", nil
}
Here I am generating uuid rollbackList[i].RequestID = uuid.New().String()
inside the workflow and assigning it to the data that I will be passing in for activity input ActivityRequest.
Let’s assume, activity failed, it keeps on retrying but fails every time. Now, if I redeploy a new version of the service and that replay the workflow.
Does it generate NEW UUID to be passed in for activity input ActivityRequest? OR It keeps the same input for activity with OLD UUID (from failed attempt) during replay by getting it from event history?
I am unable to verify it locally with testing.