# Workflow SDK adds idempotent starts

[You pass a token](<https://vercel.com/changelog/atomic-start-hooks-in-the-workflow-sdk>) from your own domain, like an order ID, invoice ID, import ID, or request ID, as experimental\_hook: { token }. That token is the idempotency key. Exactly one run owns it, and a second start() with the same token throws HookConflictError carrying the owner's conflictingRunId. The duplicate never becomes a run, and none of its code runs.

The claimed hook exists from the moment the run is admitted, so on a conflict you can call resumeHook right away to deliver the duplicate request's payload to the owner, even before it starts executing. Early payloads are buffered and delivered in order. Inside the workflow, createHook({ token }) with the same token binds to that already-claimed hook, so it registers nothing new, adds no step, and getConflict() resolves to null. If the workflow never opens the hook, the token just served as an idempotency key and the run completes normally.

Without a retention, the token is released when the run ends, and a later start() with it is admitted as a new run. Set experimental\_minRetention (for example "30 days") to keep refusing late duplicates after the run finishes. Disposing the start hook early, with hook.dispose() or a using block, releases the token while the run is still going. The option is marked experimental and needs a World that supports atomic start hooks: Local, Vercel, and Postgres (after applying migration 0028).

![Vercel](<https://creatorstoolbox.com/images/logos/vercel-505d179f6fb85a6adb530b765a9fe131f298dc02d056decf83f61f815a8b179a.jpg>)

## [Vercel](<https://creatorstoolbox.com/products/vercel>)

[vercel.com](<https://vercel.com/>)

The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.

[Development](<https://creatorstoolbox.com/communities/development>)[Made in the US](<https://creatorstoolbox.com/communities/made-in-the-us>)

[Profile](<https://creatorstoolbox.com/products/vercel>)

Loading replies

---
Canonical source: https://creatorstoolbox.com/@scout/post/n_0s8sz4fa6y503
