Skip to content

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

Closed

Description

@StephenHaney

Problem Statement

Using Cloudflare Workflows wrapper with Sentry SDK: https://docs.sentry.io/platforms/javascript/guides/cloudflare/features/workflows/

Sentry requires the workflow instance ID to be a random UUID. But part of the point of using Workflows is that if we receive duplicate webhooks, we don't double-write. So in the case of Stripe, for instance, we want to use the Stripe event ID as the workflow instance ID.

Solution Brainstorm

We can probably turn the stripe event ID into a UUID in a deterministic and non-colliding way, but then our workflows are no longer easy to trace back to the stripe event that caused them (or searchable in the CF dashboard, etc)

Ideally we could use Stripe's event ID to set the already unique-requierd workflow ID rather than needing to convert it to a UUID for Sentry.

Appreciate everyone who looks into this! 🙏

Activity

  1. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 17, 2025
  2. s1gr1d commented on Jul 18, 2025

    @s1gr1d
    Member

    Hello, one solution that would work for you here is creating a UUID out of the event ID (as you already mentioned) with, for example, createHash. As this is only one-way, you could additionally store the event ID along with the event as a tag inside your workflow to trace it back to the event again.

    withScope(async scope => {
        scope.setTag('workflow.original_instance_id', eventID);
        scope.setTag('stripe.event_id', eventID); // If it's always Stripe
    })
  3. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 18, 2025
  4. moved this to Waiting for: Community in GitHub Issues with 👀 3on Jul 18, 2025
  5. StephenHaney commented on Jul 18, 2025

    @StephenHaney
    Author

    Thanks for the tag suggestion, that is helpful. My main area to solve is actually in the Cloudflare dashboard though, where I'd like to find workflows by their stripe event.

    Instead, because we have to use UUIDs, the listings in the CF Dashboard lose meaning.
    Image

    So it's more of a UX/DX thing, we have this UUID hashing shipped to prod and it's working. It was just a surprise when we shipped it at first and got errors requiring UUID, and then lost the meaningful rows in CF dashboard.

    Side note, I originally posted this in the discord, here and Abhi asked me to open a GH issue for shared comms.

  6. moved this from Waiting for: Community to Waiting for: Product Owner in GitHub Issues with 👀 3on Jul 18, 2025
  7. timfish commented on Jul 21, 2025

    @timfish
    Collaborator

    If the instance ID doesn't match a uuid we could hash it and truncate to the same length as a uuid. It would be deterministic so we'd get the same uuid every time.

    We don't need the hash to be cryptographically secure, just uniformly distributed so SHA-1 would suffice and its fastest.

  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on Jul 21, 2025
  9. self-assigned this
    on Jul 21, 2025
  10. added a commit that references this issue on Jul 23, 2025
    27e60b7
  11. StephenHaney commented on Jul 23, 2025

    @StephenHaney
    Author

    Really appreciate you all fixing this so quickly for a quality of life thing! Makes me feel good about our choice to use Sentry 🙌

  12. added a commit that references this issue on Jul 24, 2025
    b6f5f32
  13. github-actions commented on Jul 31, 2025

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #17121, which was included in the 10.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions