Skip to content

Implement idempotency key support #121

@Chigala

Description

@Chigala

I noticed idempotency keys are on the roadmap. Looking at the codebase, the infrastructure is already in place, the DB schema has the column, the backend interface accepts it, but the client always passes null.

What I'm proposing

Wire up idempotency keys at the trigger level, similar to how Trigger.dev does it:

await orderWorkflow.run(
  { orderId: "123" },
  { 
    idempotencyKey: "order-123-process",
    idempotencyTTL: "24h"  // optional
  }
);

If the same key is used within the TTL window, return the existing run instead of creating a duplicate. We could even drop the TTL option for now.

Most of the plumbing already seems to exist, this would mainly be connecting the dots.

Future enhancement

Later we could maybe add workflow-level idempotency with CEL expressions. Starting with trigger-time keys covers most use cases.

What do you think @jamescmartinez ? 


Happy to pick this up if it sounds reasonable.

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