12.13Atomicity matters
You need some mechanism that guarantees:
only one worker can claim this key
For example:
database UNIQUE constraint
atomic insert-if-absent
distributed lock
downstream unique external ID
The strongest design often pushes uniqueness as close as possible to the system committing the side effect.