Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jul 23, 2025

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Jul 22, 2025

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
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> {
Copy link
Member

@AbhiPrasad AbhiPrasad Jul 23, 2025

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.

Copy link
Collaborator Author

@timfish timfish Jul 23, 2025

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!

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

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!
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