## TL;DR
Fix this in ERP vendor creation agent by acting on the exact problem first: search the ERP by tax ID before any create attempt, if a record exists treat creation as complete and record its identifier, and add an attempt counter that stops creation after two failed saves and reports the ERP error text instead of retrying unchanged. Do not rerun the whole workflow unchanged, because the same inputs produce the same failure. Prove the fix on one vendor first, then rerun the full scope and reconcile the results.

```text
agent stuck loop detected repeating the same step while trying to create the vendor record in the ERP
```

## Use this when
- The operation in ERP vendor creation agent fails with this exact problem: agent stuck loop detected repeating the same step while trying to create the vendor record in the ERP.
- The same failure repeats on retry with unchanged inputs.
- A vendor onboarding, payment setup, screening or vendor record step is blocked until this is resolved.

## Not for this skill when
- The notice is a platform outage from the vendor of the tool. Resolve that first, then return here if this problem remains.
- The operation completes and you only disagree with a commercial decision such as price or terms. That is a negotiation, not this failure.

## Steps
1. Reproduce the failure on one named vendor in ERP vendor creation agent and record the full problem text plus the vendor, supplier record or onboarding case involved. Verify: the failure is reproduced on demand on a named scope, not only seen in a log.
2. Apply the specific fix for this problem: search the ERP by tax ID before any create attempt, if a record exists treat creation as complete and record its identifier, and add an attempt counter that stops creation after two failed saves and reports the ERP error text instead of retrying unchanged. Verify: the single failing vendor now behaves as the fix predicts, or the corrected value is visible on the record.
3. Check neighbouring vendors, supplier records or onboarding cases that share the same automation, template or sync, because this class of failure rarely affects only one vendor. Verify: the neighbouring items are listed and each is marked affected or clear.
4. Rerun the original operation in ERP vendor creation agent on the previously failing scope, watching for the same problem rather than assuming success from a quiet log. Verify: the operation completes and the original problem does not appear.
5. Compare the result against the source of truth, the vendor master record, the signed tax form or the compliance document, so a silent partial success is caught. Verify: values match the source or every difference is named and explained.
6. Record the fix, the triggering input and the verification result on the vendor record so the next occurrence is recognised immediately. Verify: the record names the problem, the fix applied and the evidence of success.

## Variant phrasings

### agent stuck loop detected repeating the same step while trying to create the vendor record in the ERP
The verbatim form searchers paste from the console, report or run log. Treat it identically: same fix, same single vendor proof, then the full rerun.

### How to fix - agent stuck loop detected repeating the same step while trying to create the vendor record in the ERP error failure
The how to phrasing for the same failure in ERP vendor creation agent. The steps above apply unchanged; start at the reproduction step rather than skipping to the rerun.

### ERP vendor creation agent troubleshooting for this failure
The symptom first phrasing used when the console hides the full problem. Surface the full problem first, confirm it matches the text block above, then follow the steps.

## Why it happens
A create that actually saved but returned an error makes the agent create again, and only a search by tax ID before creating reveals the record that is already there.

## Edge cases
- The vendor was merged, renamed or given new banking details after the failing run started. Refresh the vendor state and reapply the fix against the current values, not the values from the failed run.
- The single vendor proof passes but the full rerun still fails on other vendors. Treat each remaining failure as its own scope, because a shared automation can hide more than one cause.
- The source systems disagree on the correct value. The vendor master record governs identity and payment details, the signed tax document governs classification and withholding, and the compliance screening governs approval status; record which source won and why.

Compatibility: ERP vendor creation agent at current versions, plus the procurement, ERP or screening platform the query names; no extra tooling beyond access to the source records needed to verify results.

## Provenance

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