What breaks when you start a workflow with lookup-then-start?
Starting a workflow with getHookByToken() followed by start() leaves a gap where duplicate starts slip through. Atomic start hooks let one start() call admit a run and claim a hook, using your own domain token as the idempotency key.
What it is
The Workflow SDK's start() can now admit a run and claim a hook in one atomic step. The token comes from your domain, like an order ID, and exactly one run owns it.
Applied case
A developer processing orders previously used getHookByToken() followed by start(), which had a documented duplicate-start race. Now they call start() with an order ID as token: the first run claims it, and a duplicate start() throws HookConflictError carrying the owner's conflictingRunId, never becoming a run. Setting experimental_minRetention keeps the token unavailable after the run ends, so late duplicates are still refused.
- Pass your order ID as token: one run owns it, duplicates throw HookConflictError with conflictingRunId
When to use it
Use when you need exactly-once workflow starts keyed by domain IDs like orders or invoices. / Skip when duplicate starts are harmless or already deduped upstream.
Read more
Recommended for you
- WorkflowOpencode
How do you keep coding agents on task without babysitting every step?
Agent sessions drift from the objective, forcing you to watch every turn; opencode's /goal lets a session run until a reviewer confirms the goal is met.
- WorkflowHerdr
How do you supervise coding agents without watching every window?
I run Claude and opencode side by side in one terminal. Three herdr habits replaced window-polling with state-waiting: persistent sessions, the agent loop, a setup script.
- WorkflowSuperpowersClaude Code
Why does your multi-agent workflow keep colliding?
Two agents in two threads share files but not context. Both decide on stale state. Fix: one fresh agent per task, with isolated context.
- WorkflowSuperpowersClaude Code
What makes agent output trustworthy when the model is not the problem?
The reliability problem is not the model. It is the missing disciplines around it. Brainstorm, plan, test, verify, review: each gate before the next step.
Enjoyed this article?
Subscribe for new articles. No spam. Unsubscribe anytime.