# Temporal Activity is somehow not generating a new uuid string while using uuid.New()

**URL:** <https://community.temporal.io/t/temporal-activity-is-somehow-not-generating-a-new-uuid-string-while-using-uuid-new/18287>\
**Category:** Developer Corner\
**Tags:** go-sdk, activity\
**Created:** [September 3, 2025, 2:14am UTC](https://community.temporal.io/t/temporal-activity-is-somehow-not-generating-a-new-uuid-string-while-using-uuid-new/18287 "2025-09-03T02:14:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anshum17](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/anshum17/32/3965_2.png) [@Anshum17](https://community.temporal.io/u/Anshum17)\
**Post date:** [September 3, 2025, 2:14am UTC](https://community.temporal.io/t/temporal-activity-is-somehow-not-generating-a-new-uuid-string-while-using-uuid-new/18287/1 "2025-09-03T02:14:30Z")

</div>

I have this activity code:

```auto
--------- service/main.go ------------
w := worker.New(temporalClient, TemporalTaskQueueName, wo)
w.RegisterWorkflow(dataretention.Workflow)
w.RegisterActivity(a)

------- activity code --------
func (a *Activities) BackupIdentitiesDataToS3(ctx context.Context, options BackupIdentitiesDataToS3Options) (BQResponse, error) {
	// 

	prefix := fmt.Sprintf("identities/%d/%d/%s/%s.parquet", options.Job.ClusterID, options.Job.EnvID, uuid.New().String(), options.Job.RequestID.String())

	// upload to s3 using prefix and bucketname 
	return

}

```

Here I am using uuid.New to generate random s3 prefix. Now whats happening is, when service restarts, somehow the activity is retried and I am seeing

```auto
Failed upload to remote storage. Key already exists at bucket_name/identities/2/4130814495/1970d68b-88d7-4fe9-8f4a-a5f150d566b3/6ccecc2b-9e1d-4d01-8eb3-c641bd8572be.parquet

```

If I am using uuid.New in prefix, and activity retries, why am I still getiing same s3 prefix? Is there any internal caching of uuid.New in temporal or something else?

---

<div class="post-metadata">

**Author:** ![peperg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/peperg/32/6478_2.png) [@peperg](https://community.temporal.io/u/peperg)\
**Post date:** [September 3, 2025, 4:03pm UTC](https://community.temporal.io/t/temporal-activity-is-somehow-not-generating-a-new-uuid-string-while-using-uuid-new/18287/2 "2025-09-03T16:03:59Z")

</div>

I’d try doing uuid.New() inside workflow code and passing it to activity as a parameter.

---

<div class="post-metadata">

**Author:** ![maxim](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/maxim/32/8_2.png) [@maxim](https://community.temporal.io/u/maxim)\
**Post date:** [September 3, 2025, 4:07pm UTC](https://community.temporal.io/t/temporal-activity-is-somehow-not-generating-a-new-uuid-string-while-using-uuid-new/18287/3 "2025-09-03T16:07:11Z")

</div>

Never use uuid.New inside the workflow as it can break determinism. Temporal doesn’t affect code inside the activity in any way. So I’m not sure what the problem is.
