In your worker configuration the states list doesn’t include executing, so an executing job is no longer considered unique and you’ll end up with multiples.
That’s fine, global partitioning by worker and args is possible. However, I suggest using an explicit list of keys whenever possible for predictability and performance.
[allowed: 1, partition: [:worker, args: :some_key]]
Based on your criteria it sounds like you might want to use the Chain worker rather than uniqueness.
Chain workers link jobs together to ensure they run in a strict sequential order. Downstream jobs won’t execute until the upstream job is
completed,cancelled, ordiscarded. Behaviour in the event of cancellation or discards is customizable to allow for uninterrupted processing, holding for outside intervention, or cascading cancellation.Jobs in a chain only run after the previous job completes successfully, regardless of snoozing or retries.
Chains use the same partitioning format as queues, so optimally you’ll match the options to ensure only one job in a chain runs at once. There’s more in the Optimizing Chains section of the module docs.


















