## TL;DR

The same idempotency key was reused across bulk jobs, confusing Salesforce's dedup. Generate a fresh key per job.

## Error

```text
duplicate bulk jobs from idempotency key reuse
```

## Steps

1. Check the key generation Expected: you find the reuse.
2. Generate a unique key per job (UUID plus job context) Expected: keys are unique.
3. Clean up the duplicate jobs Expected: the mess is resolved.
4. Assert key uniqueness in tests Expected: it cannot regress.

## When to use

- Duplicate bulk jobs
- The idempotency key was reused

## When not to use

- Keys are unique (then check for retried submissions)
- Duplicates are intended (then they are not duplicates)

## Tool compatibility

- Idempotency keys
- Bulk API jobs

## Variant phrasings

### idempotency key reuse

Generate a fresh key per job.

### duplicate bulk jobs

Same: the key was reused.

## Why it happens

Agents cache the key with the payload template. The key must be per-attempt, not per-template.

## Edge cases

- Keys should expire; do not reuse old ones
- Log keys with jobs for forensics

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_OAcdYGpXNGIm7NN6pDPMsw
