Skip to content

[@useautumn/convex] Cannot use autumn.track within a Workflow #51

@dantman

Description

@dantman

The documentation says to use autumn.track to track usage.

await autumn.track(ctx, {
  featureId: "messages",
  value: 10,
});

This appears to exclusively use the user identity in ctx to get the customerId.

However Convex also has Durable Workflows. When an action is run from a workflow it does not inherit the user identity the workflow was started with.

As a result attempting to integrate the Autumn component to track usage happening inside of a workflow results in "Uncaught Error: No customer identifier found for Autumn.identify()".

The pattern I have been using with other parts of Convex is to pass the user ID of the user running the workflow as one of the Workflow's arguments. But this does not work with autumn.track as I cannot override the customerId.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions