Skip to content

fix(cloudflare): Allow non uuid workflow instance IDs#17121

Merged
AbhiPrasad merged 8 commits into
developfrom
timfish/feat/cloudflare-workflows-non-uuid
Jul 23, 2025
Merged

fix(cloudflare): Allow non uuid workflow instance IDs#17121
AbhiPrasad merged 8 commits into
developfrom
timfish/feat/cloudflare-workflows-non-uuid

Conversation

@timfish

@timfish timfish commented Jul 22, 2025

Copy link
Copy Markdown
Collaborator

If the instanceId is not a uuid like string (ie. 32 hex characters with or without hyphens) we SHA1 hash the instanceId to create a uuid.

@timfish timfish requested a review from AbhiPrasad July 22, 2025 09:47
Comment thread packages/cloudflare/src/workflows.ts Outdated
if (!UUID_REGEX.test(instanceId)) {
throw new Error("Invalid 'instanceId' for workflow: Sentry requires random UUIDs for instanceId.");
}
async function hashStringToUuid(input: string): Promise<string> {

@AbhiPrasad AbhiPrasad Jul 23, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add some unit tests for this? Lets test some different kind of inputs.

@timfish timfish Jul 23, 2025

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also changed this to be called deterministicTraceIdFromInstanceId since that's what it actually does!

@AbhiPrasad AbhiPrasad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to backport this for v9 as well btw

@timfish timfish force-pushed the timfish/feat/cloudflare-workflows-non-uuid branch from 7004f5c to acd3ecf Compare July 23, 2025 13:07
cursor[bot]

This comment was marked as outdated.

@AbhiPrasad AbhiPrasad merged commit 27e60b7 into develop Jul 23, 2025
44 checks passed
@AbhiPrasad AbhiPrasad deleted the timfish/feat/cloudflare-workflows-non-uuid branch July 23, 2025 13:42
AbhiPrasad pushed a commit that referenced this pull request Jul 24, 2025
- A backport to v9 of #17121 
- Closes #17074

@StephenHaney unless you're a very early adopter of v10, this PR is
probably the one you care about!
AbhiPrasad pushed a commit to getsentry/sentry-docs that referenced this pull request Jul 27, 2025
In this PR we removed the UUID limitations around `instanceId`s in
Cloudflare workflows.
- getsentry/sentry-javascript#17121

This PR updates the docs to reflect this change!
lucas-zimerman pushed a commit to getsentry/sentry-docs that referenced this pull request Jul 29, 2025
In this PR we removed the UUID limitations around `instanceId`s in
Cloudflare workflows.
- getsentry/sentry-javascript#17121

This PR updates the docs to reflect this change!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cloudflare Workflows - sentry requires UUID but that removes a benefit of workflows

2 participants