Skip to Content
All Systems

02IntegrationsType: Reference architecture

Every record accounted for: migrating into a live CRM with an AI agent under rules

A reference design for loading a live Zoho CRM with no sandbox: an AI agent does much of the hands-on work, and written rules limit what it touches.

Shows

  • Applied AI
  • Data Migration
  • Business Automation

Where this comes from: Drawn from systems I've designed on Zoho. The business, names and data here are generalized. The patterns and failure modes come from real work, and the design includes what that work taught me.

On This Page

In 30 Seconds

A company moves customers, contacts and products from ERP exports into a live Zoho CRM with no sandbox. An AI agent (Claude Code) profiles the source, builds the files, checks them against the live configuration and reconciles the result. Written rules bound it: read-only by default, a backup before any write, a pilot before the full load, and a person for anything irreversible. Records land on the key the ERP sync will use, so the sync takes over without re-matching.

What It Guarantees

  • Nothing is written before a backup exists.
  • Every row is checked against the live CRM configuration, layouts included.
  • Every record is reconciled by key: count, identity and values.
  • The agent reads production freely and changes it only in approved steps.
  • A repair changes only the wrong records, and proves it.

The Problem

A common setup: a company has run sales from spreadsheets and an ERP, and is moving to Zoho CRM. The CRM is already live, with users, test records, workflows and an assignment rule that emails each new owner. There is no sandbox, and the source holds more than twenty thousand records.

Both sides have traps. Different customers legitimately share an email or a mobile number. Some codes hide look-alike characters, and some numbers are stored as text. In the CRM, some picklist labels differ from the values they store. Some fields are required only on a layout. In my tests, some settings calls answered "success" and changed nothing. It may have changed since.

An ERP sync starts right after and must find every imported record. By hand, the work is slow and hard to repeat exactly. An agent with full access puts a live CRM at risk.

The Approach, in One Sentence

An AI agent works from a written runbook, and nothing reaches the live CRM until a backup, a live preflight and a pilot have passed, all keyed on the ids the sync will use.

Architecture

How records move into the live CRM
Profile the sourceKeys, duplicates and formats, with read-only access
Map to live CRMStored picklist values, layout rules, ERP ids as keys
Backup firstConfiguration and records saved before any write
Fix config, preflightFields and picklists first, then every row checked
Pilot batchHand-picked edge cases, each with a written reason
Pilot reads back right?Before and after compared; if not, fix and rerun
Full loadAutomations off; upsert on the ERP id
Targeted repairSnapshot first; only wrong records; prove nothing else changed
Reconcile by keyCount, identity and values against the source
Sync takes overSame keys, so no second matching pass

Connections in this diagram

  • Profile the source → Map to live CRM
  • Map to live CRM → Backup first
  • Backup first → Fix config, preflight
  • Fix config, preflight → Pilot batch (zero errors)
  • Pilot batch → Pilot reads back right?
  • Pilot reads back right? → Full load (yes)
  • Full load → Reconcile by key
  • Reconcile by key ↔ Targeted repair (mismatch)
  • Reconcile by key → Sync takes over (all match)

Key Decisions

  1. Key every record on the ERP's internal id, the one the sync upserts on

    The alternatives were email or phone, a legacy code, or matching later. Customers legitimately share emails and mobiles. A legacy code works for the import but leaves the sync to re-match everything. With the ERP id in a unique CRM field, the sync finds each record on its first run, and a correction pass is an update, not a duplicate.

  2. Validate against the live CRM, not the documentation

    The alternatives were the import tool's own checks, or field definitions alone. A picklist label can differ from the value it stores, and writes, filters and automations all use the stored value. A field can be required on a layout while the fields API calls it optional. A first load once skipped rows for exactly this.

  3. A pilot of hand-picked edge cases, never skipped

    The alternatives were going straight to the full load, or a random sample. Static checks can't see what automations, derived fields and the importer actually do. The pilot is about twenty records, each picked for a reason: an existing record to update, a normalized code, the longest name, the highest price. When the input changes, the pilot runs again.

  4. Read-only by default; anything irreversible goes to a person

    The alternatives were full access for speed, or every step by hand. Without a sandbox, every write is a production write. The agent analyzes with a read-only credential and writes only in steps I've approved, each after a backup.

When Things Go Wrong

  • A picklist label doesn't match its stored value

    The preflight compares every value with the stored values. I fix mismatches while the modules are nearly empty and the fix is small.

  • A value disappears in transformation

    A price with a thousands separator can become a blank without an error. The parser fails loudly, and reconciliation compares values, not only keys. A key-only check once passed with prices missing.

  • An automation fires during the load

    Workflows and assignment rules are off, and owners are set explicitly, so no rule emails a new owner per record.

  • A repair is needed

    A snapshot comes first. Only the wrong records change, by id, with values taken again from the source and automations off. A full re-fetch proves nothing else changed. Unexplained differences wait for a person.

  • The agent reads the wrong org

    An AI tool's connector or a saved login can quietly point at a demo org. Every analysis names the org it read, and the read-only client refuses any other.

What the Business Gets

  • Clean picklists and fields from the first record, so reports and assignment work on day one.
  • The ERP sync starts without a matching project.
  • Later corrections are routine keyed updates, never a delete-and-reload.
  • Every data decision, rejection and repair has a written reason.

For Engineers

How I Build Systems Like This

I write the runbook and the rules before the agent starts: the order of steps, what it may read and write, and what needs me. The agent (Claude Code) does the profiling, scripts, checks and reports. I make the scope and data decisions, each written down with its reason. The method comes from a migration of more than twenty thousand records into a live Zoho CRM.

How I Build With AI

On LinkedIn: more notes on Zoho architecture and AI.