[KongchangAI]
Concept

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)

Nov 4

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.

Unverified50%
Nov 4

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.

Unverified50%
Nov 4

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.

Unverified50%

All Facts (3)

Source Articles