# Recovery loops: a worked import example | SourceX

Canonical: https://refer.sourcex.si/guides/recovery-loops-workflow-example
Last updated: 2026-11-04

A recovery loop is a run of attempts in which each failure is checked, diagnosed and fixed before the next try, until a defined check passes. In an ordinary business, it looks like a migration team importing open receivables three times: the first run lands $143,580 short, the second $18,400 over, and the third matches the legacy control exactly before the controller signs off. The valuable record is the whole sequence, not the clean final number.

This worked example is part of the guide on [recovery loops: five questions for introducers](/guides/concept-recovery-loops). That guide helps you ask whether a client kept these records. This page walks through one loop end to end so you can recognise one when a controller describes it.

## The task and its control (Illustrative)

**Illustrative and fictional.** A 240-person building-products distributor is cutting over from a legacy accounting package to a new ERP. One cutover task is loading every open customer invoice. The legacy aging report is the control: 3,412 open items totaling $1,846,220.

The pass condition is written before the first run: the item count and total must equal the control, every aging bucket must match, and no adjusting entry may be posted to force a match. That last clause matters later.

AI research has a name for this pattern of attempt, feedback and retry. Reflexion, a NeurIPS 2023 paper, describes language agents that improve across attempts by writing reflections on feedback into a memory that guides the next try, rather than by retraining. Here the import error report is the feedback, the analyst's note is the reflection and the next run is the retry.

## Step by step: three runs, two fixes, one sign-off

| Step | What happens | Decision taken | Record left behind |
|---|---|---|---|
| 1. Extract control | Legacy aging report run as of cutover | Accept 3,412 items, $1,846,220 as the target | Aging report with count and total |
| 2. Run 1 | 3,200 of 3,412 rows load; imported total $1,702,640 | Stop: $143,580 short | Import job log with succeeded and failed counts |
| 3. Diagnose run 1 | 212 rows rejected: customer IDs missing from the new customer master | Fix master data, not the file | Analyst note on the rejection report |
| 4. Fix 1 | 31 missing customers created, approved by the master data owner | Rerun the full file | Customer creation entries with user and time |
| 5. Run 2 | 3,412 of 3,412 rows load; imported total $1,864,620 | Stop: $18,400 over | Second import job log |
| 6. Diagnose run 2 | 23 credit memos worth $9,200 loaded as positive invoices | Repair the mapping, do not post an adjustment | Analyst note naming the document type |
| 7. Fix 2 | Sign reversed for the credit memo document type | Rerun | Versioned mapping file or change ticket |
| 8. Run 3 | 3,412 of 3,412 rows; imported total $1,846,220 | Difference $0; compare buckets | Third import job log |
| 9. Sign-off | Controller compares aging buckets, all match | Approve cutover of receivables | Signed reconciliation workbook |

Microsoft's documentation for Dynamics 365 data import jobs describes this tooling: each run records execution details, including records that succeeded and failed per entity, and an execution log, and failing records can be fixed and reimported. Other ERPs differ in detail, but most leave a per-run trace of some kind.

## Reading the numbers: why run 2 is the instructive one

Read down the differences: $143,580 short, then $18,400 over, then $0. Two details reward a closer look.

First, the run 1 shortfall hid part of the problem. The 23 credit memos were already loading as positive amounts in run 1. So the 212 rejected rows were actually worth $161,980, partly masked by the $18,400 overstatement: $1,846,220 minus $161,980 plus $18,400 gives the $1,702,640 that run 1 reported. An analyst who stopped at "load the missing customers" would have been surprised by run 2.

Second, a $9,200 credit loaded as a positive amount moves the total by twice that, which is why run 2 is over by $18,400 rather than $9,200. An analyst under time pressure could have posted an $18,400 adjusting entry and reached zero without repairing the mapping. The pass condition forbids that, and the reason it matters is the reason the loop has value: the fix itself, not just the final total, belongs in the record. A reviewer must be able to tell a repaired mapping from a forced balance. Our page on [why AI agents fail](/questions/why-ai-agents-fail) describes the same risk in software agents: reaching the right-looking answer by the wrong route.

## Which records carry the signal

Not every record above is equally useful to an AI-data review. The ones that carry signal are those that connect a failure to its cause and its fix.

| Record | Signal it carries | Strength if missing |
|---|---|---|
| Aging report (control) | Defines the target the loop is judged against | Loop cannot be judged at all |
| Run 1 and run 2 job logs | Show each failure and its size | Loop collapses to a single successful run |
| Analyst diagnosis notes | Explain why each run failed, in plain language | Fixes look like guesses |
| Customer creation entries and mapping version | Show exactly what changed between runs, and who changed it | Cannot tell repair from luck |
| Run 3 job log | Shows the pass | Weak: the final ERP balance also shows it |
| Signed reconciliation | Confirms the bucket check and a named approver | End point is unverified |

The middle rows, diagnoses and fixes, are the heart of it, and they are the most likely to be lost. Microsoft's documentation notes that by default, Dynamics 365 deletes job history and related staging data older than 90 days. A company that migrated years ago on default settings may have no runs 1 and 2 in the tool, only in exported error files or project folders. The [evidence gaps page](/questions/recovery-loops-evidence-gaps) covers those losses in detail.

## Why real loops differ from generated ones

Vendors such as Appen market agentic AI data services built around failure-mode taxonomies, golden trajectories and verifiers. That shows the category exists. It does not show demand for any particular company's migration records, and SourceX does not claim to have bought this type of data. What a real loop offers that a generated one may not is the odd, compound failure, like a missing master record masking a sign error, discovered and fixed by people working to a deadline. Whether generated failures can stand in for that is part of the debate over [whether synthetic data will replace real data](/questions/will-synthetic-data-replace-real-data).

Similar retry trails appear in month-end loads, bank file changes and integrations. [Process mining](/questions/what-is-process-mining) shows how event logs reveal such patterns across a business, and the [software workflow example pack](/resources/software-workflow-example-pack) covers software workflow records more broadly. Reconciliation breaks more broadly are under [reconciliation exceptions](/data-types/reconciliation-exceptions-ai-agent-training-data).

## Who owns the loop, and does the company qualify?

Migration records usually belong to the operating company, though an outside implementation partner may hold copies under its engagement contract. The controller or CIO typically owns them, and the CEO can authorize a licensing discussion.

The company needs 50+ full-time employees at peak (contractors excluded), documented operating history, rights to license and an authorized contact. Companies in the U.S., Canada and the EU qualify, as do companies in the UK, Australia, New Zealand, India, Singapore, South Africa, Latin America, the UAE and Saudi Arabia when at least 70% of the data is in English.

Unknown until SourceX reviews it: how many loops survive intact, how customer details are de-identified, buyer interest and any offer. Partners stay at metadata level: which systems, how many migrations, how many years, who owns the files. The [review packet contents list](/resources/recovery-loops-review-packet) shows what the company would assemble later. More record families are in [data types](/data-types).

## Next step

> **Refer a company. No cap on rewards.** Default reward on a company's first qualifying transaction: the greater of $50,000 plus 5% and 15% of Actual Supplier Payout, with no cap; further qualifying transactions first agreed within 12 months of the first Closing pay 15%. Eligibility and payment conditions apply, including the USD 100,000 Minimum Transaction, and a signed Schedule A or addendum can differ. A lead, meeting or signature alone does not trigger payment.

If a client's controller can describe a migration like this one with the failed runs and fixes still on file, [register as a partner](/register), check [who qualifies](/who-qualifies), and read the [program terms](/terms) before introducing the CFO.

## Sources

- https://papers.nips.cc/paper_files/paper/2023/hash/1b44b878bb782e6954cd888628510e90-Abstract-Conference.html
- https://learn.microsoft.com/en-us/dynamics365/fin-ops-core/fin-ops/data-entities/data-import-export-job
- https://www.appen.com/agentic-ai
- https://refer.sourcex.si/terms
