Skip to content

Comments

Add support for idempotency keys#287

Merged
jamescmartinez merged 4 commits intomainfrom
idempotency
Feb 12, 2026
Merged

Add support for idempotency keys#287
jamescmartinez merged 4 commits intomainfrom
idempotency

Conversation

@jamescmartinez
Copy link
Contributor

@jamescmartinez jamescmartinez commented Feb 12, 2026

Closes #121, Closes #136

Summary

This pr implements idempotency so reusing the same idempotencyKey returns the existing run (within 24h)

ow.runWorkflow(spec, input, { idempotencyKey })

Docs updated with additional info

Copilot AI review requested due to automatic review settings February 12, 2026 18:42
@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds idempotency key support to OpenWorkflow run creation so repeated requests with the same key return the existing canonical run (per namespace + workflow), with coverage across both SQLite and PostgreSQL backends.

Changes:

  • Pass idempotencyKey from OpenWorkflow.runWorkflow() / workflow.run() into backend run creation.
  • Implement idempotent run creation in SQLite (transaction + lookup) and Postgres (advisory-lock + lookup) backends.
  • Add backend + client test coverage and update docs/changelog/roadmap to document the feature.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/openworkflow/sqlite/backend.ts Adds idempotent run creation logic for SQLite via transaction + lookup.
packages/openworkflow/postgres/backend.ts Adds idempotent run creation logic for Postgres via advisory lock + lookup.
packages/openworkflow/client.ts Wires idempotencyKey option through to backend.
packages/openworkflow/client.test.ts Adds client-level tests verifying idempotency key persistence and dedupe behavior.
packages/openworkflow/backend.testsuite.ts Adds cross-backend behavioral tests for idempotency semantics and concurrency.
packages/openworkflow/README.md Updates feature list to include idempotency keys.
packages/openworkflow/CHANGELOG.md Notes unreleased idempotency support.
packages/docs/docs/workflows.mdx Documents optional idempotency key usage and semantics.
packages/docs/docs/roadmap.mdx Moves idempotency keys from “Coming Soon” to completed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings February 12, 2026 20:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jamescmartinez jamescmartinez merged commit 68dd6e3 into main Feb 12, 2026
8 checks passed
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.

Implement idempotency key support

1 participant