Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/docs/docs/roadmap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ description: What's coming next for OpenWorkflow
- ✅ Workflow versioning
- ✅ Workflow cancelation
- ✅ Configurable retry policies
- ✅ Idempotency keys

## Coming Soon

- Idempotency keys
- Rollback / compensation functions
- Signals for external events
- Native OpenTelemetry integration
Expand Down
20 changes: 20 additions & 0 deletions packages/docs/docs/workflows.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,26 @@ defineWorkflow(
Any `retryPolicy` fields you omit fall back to defaults. See
[Retries](/docs/retries) for the full behavior and defaults.

### Idempotency Key (Optional)

You can prevent duplicate run creation by providing an idempotency key, though
there is a performance cost to checking for duplicates, so use this only when
necessary:

```ts
const handle = await ow.runWorkflow(
sendWelcomeEmail.spec,
{ userId: "user_123" },
{ idempotencyKey: "welcome-email:user_123" },
);
```

Within a given namespace, when an existing run matches the same
`workflowName` + `idempotencyKey`, OpenWorkflow returns that existing run
immediately. This dedupe window is built-in and lasts 24 hours from the original
run creation time. The same `idempotencyKey` used in a different namespace will
create a separate run.
Comment thread
jamescmartinez marked this conversation as resolved.

## Workflow Function Parameters

The workflow function receives an object with three properties:
Expand Down
6 changes: 6 additions & 0 deletions packages/openworkflow/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# openworkflow

## Unreleased

- Add workflow-scoped idempotency keys via
`ow.runWorkflow(spec, input, { idempotencyKey })`
- Built-in run idempotency dedupe period is 24 hours from run creation time

## 0.6.7

- Add support for Bun as an alternative to Node
Expand Down
1 change: 1 addition & 0 deletions packages/openworkflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ For more details, check out our [docs](https://openworkflow.dev/docs).
- ✅ **Long pauses** - Sleep for seconds or months
- ✅ **Scheduled runs** - Start workflows at a specific time
- ✅ **Parallel execution** - Run steps concurrently
- ✅ **Idempotency keys** - Deduplicate repeated run requests (24h window)
- ✅ **No extra servers** - Uses your existing database
- ✅ **Dashboard included** - Monitor and debug workflows
- ✅ **Production ready** - PostgreSQL and SQLite support
Expand Down
Loading