HookConflictError
HookConflictError is an error type thrown in the Workflow SDK when start() attempts to claim a hook token that is already occupied. It is used to detect and prevent duplicate starts.
Timeline (last 90 days)
When experimental_hook: { token } is passed in during the atomic start call, if the token is not occupied the run is admitted and the hook belongs to it; if the token is already occupied, a HookConflictError is thrown carrying the conflictingRunId.
By catching the HookConflictError and calling resumeHook, the payload of a duplicate request can be routed to the existing run, returning the same runId with started set to false, without the need for distributed locks or database unique constraints.
Idempotency is guaranteed by the token alone: exactly one run owns it, and a duplicate start() throws a HookConflictError carrying the conflictingRunId and never turns into a new run.
All Facts (3)
When experimental_hook: { token } is passed in during the atomic start call, if the token is not occupied the run is admitted and the hook belongs to it; if the token is already occupied, a HookConflictError is thrown carrying the conflictingRunId.
50%UnverifiedBy catching the HookConflictError and calling resumeHook, the payload of a duplicate request can be routed to the existing run, returning the same runId with started set to false, without the need for distributed locks or database unique constraints.
50%UnverifiedIdempotency is guaranteed by the token alone: exactly one run owns it, and a duplicate start() throws a HookConflictError carrying the conflictingRunId and never turns into a new run.
50%