AI & Automation

Integrating AI into Existing Systems: ERP, CRM and Legacy Applications

6 min read Team Barquecon 26 November 2026

Most companies won't replace their ERP, CRM or the in-house system that runs the business just to "get AI". They shouldn't. The value is in connecting AI to the systems and data they already have: reading an invoice into the ERP, drafting replies from CRM history, answering staff questions from internal documents, or turning a machine alert into a work order.

That connection is where most of the work is, and most of the risk. This guide covers six ways to integrate AI with existing systems, how to choose, how to handle permissions and data, and how to let AI write back into core systems safely.

Six integration patterns

#PatternHow it worksGood forWatch out for
1API call from a workflowA workflow (or your app) sends data to an AI model and uses the resultClassification, extraction, summariesKeep prompts and outputs logged
2Event-drivenA new record (email, document, alert, order) triggers the AI step automaticallyDocument intake, triage, alertsDuplicates and retries: design for "run twice, same result"
3Retrieval over your documents (RAG)The AI answers using passages found in your own documents and records, with citationsPolicy, product and process questions, contract searchAccess control: users must only see what they're allowed to see
4Assistant inside the applicationAn AI panel in the ERP or CRM screen that drafts, explains or suggestsSales, support and finance usersThe assistant must respect the user's permissions
5Middleware or workflow platformA tool such as n8n connects the systems and the AI model, with approvals and error handlingSeveral systems involved, approvals neededNeeds an owner, monitoring and version control
6UI automation for systems with no APISoftware operates the old system's screens like a user (robotic process automation)Legacy systems you can't changeFragile when screens change. Use as a last resort

Choosing the right pattern

Your situationStart with
One system, one clear task (for example classify incoming emails)Pattern 1 or 2
Staff spend time looking things up in documentsPattern 3 (RAG)
Users work all day in one applicationPattern 4
The task crosses several systems and needs approvalPattern 5
The legacy system has no API and can't be changedPattern 6, or build a small API in front of it

Data and permissions: the part that decides success

  1. AI should never have broader access than the person it serves. If a sales user can't see finance records, neither can the assistant answering them.
  2. Start read-only. Let AI read and suggest before it writes anything.
  3. Give access through defined actions ("look up order", "create draft invoice"), not direct database access.
  4. Decide what may leave your environment. Some data can go to an external AI model. Some must stay on infrastructure you control. Under India's DPDP Rules 2025, map any personal data involved.
  5. Log everything: inputs, outputs, who approved what. CERT-In requires ICT system logs to be kept for 180 days within India.

Writing back into core systems safely

When AI creates or changes records in an ERP or CRM:

  • Create drafts, not final records. A person approves the draft purchase invoice, work order or customer reply.
  • Prevent duplicates. Give each request a unique key, so a retried event never creates a second record.
  • Validate before writing: required fields, totals that add up, a vendor that exists.
  • Keep a dry-run mode for testing against your real system without creating live records.

Our engineering note on turning an IoT alert into an ERP work order shows these ideas in practice: an n8n flow that maps an alert to an ERPNext work order, with a dry-run mode and a duplicate check.

An example: AI with ERPNext

Use casePatternFlow
Supplier invoice intake2 + 5Invoice email arrives → AI extracts supplier, amounts, GST details → matched to purchase order → draft purchase invoice in ERPNext → accounts approves
Maintenance work orders2 + 5Machine alert → work order created in ERPNext automatically, no duplicates (see our note above)
Ask the ERP3"What's pending delivery for customer X?" answered from ERP records and order documents, within the user's permissions
Sales follow-ups4Assistant drafts a follow-up email from the customer's order history

These are integration patterns, not descriptions of specific client projects.

What about legacy systems with no API?

OptionWhen it fits
Read from a database copy (a read replica or a nightly export)You only need to read data
Use existing file exports (CSV, reports)Data doesn't need to be real-time
Build a small API in front of the systemYou'll integrate with it more than once. Usually the best long-term choice
UI automation (RPA)Nothing else is possible. Monitor it closely

Cost, speed and reliability

  • Batch where you can: many tasks (nightly reconciliation, report summaries) don't need instant answers, and batching cuts cost.
  • Cache repeated answers, and don't send more data to the model than the task needs.
  • Plan for AI being wrong: confidence checks, validation rules, and a person reviewing exceptions.
  • Monitor quality, not just uptime: sample outputs every week.

A 6-week plan

WeekStep
1Pick one task. Measure today's time and error rate. Map the systems and data involved
2Choose the pattern. Agree permissions, data rules and the approval step
3–4Build in a test environment, with drafts only, logging and a dry-run mode
5Test on real past cases. Run in parallel with the current process
6Go live with approvals. Measure time saved and accuracy. Decide the next task

(For workflow tooling, see our n8n business process automation guide. For the bigger picture, see enterprise AI from demo to production.)

Frequently asked questions

How do you integrate AI into existing systems?

Pick one task, choose an integration pattern (API call, event trigger, document retrieval, in-app assistant, workflow platform or UI automation), give the AI only the access it needs, and have people approve what it writes back.

Can AI be integrated with ERPNext?

Yes. ERPNext has a REST API, so AI steps can read records and create draft documents, such as purchase invoices or work orders, for approval.

Do we need to replace our ERP to use AI?

No. Most value comes from connecting AI to the ERP you already run.

Is it safe to let AI write into our ERP?

Yes, if it creates drafts that a person approves, validates data before writing, prevents duplicates and logs every action.

What if our system is old and has no API?

Read from a database copy or file exports, build a small API in front of it, or, as a last resort, use UI automation.

Want AI working inside the systems you already have? We'll pick the first task with you and build it with permissions, approvals and logging. Talk to our team →

Let's Work Together

Contact Us and We'll Help You

Whether you have a question, an idea, or a project in mind, our team is ready to assist you every step of the way.