How to specific an err activity in 1000 same parallel activities?

I have an activity, like below

func () DoSth () error {
	// sth might error
}

and I need a really big parallel to execute the activity, like below

futures := make([]workflow.Future, 0, 1000)
for index := 0; index < 1000; index++ {
	future := workflow.ExecuteActivity(ctx, DoSth)
	futures = append(futures, future)
}

// parallel get future

my problem is that, when I got error from future, I cant figure out the error activities ,which is important in my case

I can prepare uuid for activity and record the uuid, but I cant find a way to send the uuid to activity neither get the uuid when I get error from future

any suggestions?

I’m not sure I understand your problem. You get an error from the future when you call Get on it. The specific future that returned the error corresponds to the activity that returned the future.

the case is that when I get an error form “future.Get()” . I might need to reset the running from the error activity, I need to specific the error activity’s “WorkflowTaskCompletedEventId”. when I reset, I need an event id (WorkflowTaskCompletedEventId)

you are right, when I get an error I can specific a future, let’s change the question, how can I get activity’s WorkflowTaskCompletedEventId from the future

or there is an easier way to reset the workflow running to rerun the error activity?

This is not going to work as all the activities will be started as part of the same workflow task. So all the parallel activities are going to have the same WorkflowTaskCompletedEventId.