| Author: Abdullah Ahmed | Category: API Development and Integration
A sales coordinator asks an assistant to check a customer's order and send an update. The CRM holds the relationship, the ERP holds allocation and delivery information, and email carries the conversation. Connecting all three does not create one consistent business record automatically. The integration must decide which system owns each fact and which actions the assistant may request.
AI agents can help gather context across systems and prepare a useful next step. The difficult engineering lies in identity mapping, permission boundaries, conflicting state, and partial execution. A fluent summary of disconnected data is not enough when the workflow can update records or contact customers.
This article follows an illustrative order-status coordination task. It explains how to design a maintained integration layer between CRM, ERP, email, and related applications without giving an agent unrestricted authority over them.
Start with a cross-system case, not a list of connectors
Define one outcome the business needs, such as prepare an accurate delivery update for a verified customer. List the facts required and the actions that complete the task. This provides a reason for each connection.
Avoid beginning with connect every available system. Each connector adds credentials, data mappings, failure modes, and ownership. Broad access can increase complexity without improving the first workflow.
Describe the case's boundaries. Checking allocation may be permitted, while changing a delivery commitment may require an authorised planner. Preparing an email may be allowed, while sending it requires a separate decision.
Name the staff who will use and repair the workflow. A design that depends on several applications needs an operational owner for the whole case, even when different teams maintain individual systems.
Assign authority to facts and operations
Create a field and operation ownership map. The CRM may own the customer relationship, the ERP the order fulfilment state, and the email system the delivery status of a message. Do not treat whichever copy is easiest to retrieve as universally authoritative.
Define what each status means. An ERP allocation status may differ from a CRM opportunity stage, and neither necessarily confirms dispatch. Similar labels can conceal different business events.
Keep historical notes distinct from current facts. A salesperson's earlier estimate can be useful context without overriding the ERP's current confirmed state. The assistant should show conflicts rather than silently choose the more reassuring value.
Decide where corrections belong. If an account mapping is wrong, repair the mapping or authoritative record through its owner. Repeatedly editing generated summaries does not solve the underlying integration problem.
Build stable identity mappings
A company name or email address is not always a stable cross-system identifier. Organisations can have several contacts, renamed accounts, merged records, and separate billing or delivery entities.
Maintain explicit mappings between CRM accounts, ERP customers, orders, and verified communication identities. Record how mappings are created and who can resolve ambiguity.
Use deterministic validation when known identifiers exist. If the assistant proposes a match from similar names, require the supported review path before any consequential action uses it.
Test duplicate and merged records. A pilot with clean sample accounts may miss the historical inconsistencies that dominate real operational work. Incorrect identity mapping can make every later lookup appear plausible while targeting the wrong customer.
Preserve the initiating actor's authority
An interactive agent should act within the authenticated user's permitted scope. The integration layer must not silently substitute a broad service account that exposes data the user cannot access.
Where a background workflow legitimately uses a service identity, define its purpose and resource limits. The business should understand what it can read and change without a person present.
Enforce resource-level permissions at the relevant services or through a reviewed application boundary. A model-supplied customer identifier is not evidence of access rights.
Keep credentials outside prompts and tool responses. The agent needs a description of permitted capabilities, while the adapter handles authentication and records the actor context for audit.
Wrap business capabilities in narrow tools
Useful tools might include retrieve confirmed order status, retrieve approved contact, prepare update draft, and submit approved message. Each should have a validated schema and a clear result contract.
Avoid exposing a generic SQL executor or unrestricted HTTP client merely because it can reach every application. Narrow operations make permissions and side effects easier to inspect.
Return only relevant fields and explicit states such as found, ambiguous, forbidden, unavailable, or pending. An empty response should not force the model to guess what happened.
Document the operation's side effects. A tool that creates a draft and one that sends a message must remain distinct in both naming and implementation. The server should enforce the boundary regardless of the model's interpretation.
Gather context without creating a new master database
An integration may need a working case record, but it should not automatically become a second customer or order master. Store references, source versions, proposals, and task state rather than duplicating every business field unnecessarily.
If a local cache is needed, define freshness and invalidation. A cached allocation status can become misleading when used to make a new customer commitment. Show retrieval times where they affect the decision.
Keep source evidence connected to the generated draft. The coordinator should be able to inspect the ERP status and relevant CRM context without searching from scratch.
Resolve conflicts explicitly. If the CRM note promises Friday but the ERP has no confirmed date, the assistant can prepare an internal clarification rather than send the older promise as current fact.
Treat email as both data and an external action
Incoming email may contain useful context, attachments, and requests, but its content is not authority to change the agent's tools or permissions. Embedded instructions should remain material to interpret.
Outgoing email creates a customer-facing effect. Verify the recipient through the supported account context and show the final content when review is required. Do not infer that every address mentioned in a thread is an authorised destination.
Separate draft creation, submission, and delivery status according to the mail service's contract. An accepted API request does not necessarily prove that the recipient received the message.
Use a stable message operation reference. A lost response or repeated user request should not cause the assistant to send the same update repeatedly while believing each attempt is new work.
Keep approvals specific to the cross-system effect
A reviewer should see the customer, order, factual basis, proposed message, and any record changes. Approving a broad plan to update the customer is weaker than approving the actual operation.
Bind approval to the proposal version. If the agent refreshes the ERP data and changes the message afterward, the workflow must determine whether the earlier approval still applies.
Revalidate current state and authority before execution. Another employee may have contacted the customer or changed the order while the proposal waited. The operation should account for those changes rather than overwrite or duplicate them.
Keep approval evidence in application state. A conversation transcript alone is difficult to use as a reliable transaction boundary, especially when several people collaborate on the case.
Plan for partial success across applications
Suppose the CRM note is saved but the email service times out. The workflow should record that the note exists and the message outcome is uncertain. It should not replay both actions automatically.
Persist intent and per-operation status before and after consequential calls as appropriate to the architecture. Use destination-supported idempotency and lookup mechanisms where available.
Define recovery for each operation. Some actions can be reversed directly; others require a compensating change or a person to resolve the case. A cross-system workflow rarely behaves like one local database transaction.
Expose the confirmed and unresolved steps to operators. A generic failed status hides the information needed to repair the case safely and can lead staff to repeat work that already completed.
Coordinate event delivery and reconciliation
Webhooks or messages can notify the integration about changed orders or replies. Verify origins, persist events, and handle duplicate or delayed delivery according to each provider's contract.
Do not assume event order equals business version order. A later-arriving event may describe an older state. Use supported versions or current-state checks where appropriate.
Reconcile important business relationships periodically. Look for cases whose referenced order no longer exists, messages without confirmed outcomes, or completed ERP changes absent from the coordination record.
Treat reconciliation as a supported workflow with owners and safe repair actions. It should produce actionable cases rather than a large unexplained mismatch report nobody reviews.
Limit the agent's autonomy and resource use
A cross-system agent can make many calls without adding useful information. Define a stopping condition, time budget, call budget, and escalation route for the task.
Handle rate limits and retries in the integration runtime. Several concurrent cases may share the same ERP quota or email service account. The model should not independently manage traffic through improvised retries.
The OWASP AI agent security guidance covers tool boundaries, prompt injection, and unbounded resource use. These risks are relevant when an assistant can move between private records and external communication in one workflow.
Start with the smallest set of capabilities that produces a useful case. Additional access should follow a demonstrated task need and updated evaluation, not the convenience of an available connector.
Make traces useful across organisational boundaries
Use a correlation reference linking the agent task, CRM record, ERP order, and message operation. This lets each system owner investigate their part without exchanging unfiltered logs.
Record application decisions separately from generated explanations. A permission denial or confirmed submission is stronger operational evidence than a model's narrative about what it intended.
Protect trace content with appropriate access and retention. Cross-system logs can reveal information that no single user should see together if they are collected without care.
Agree on incident ownership and escalation. The case owner coordinates resolution, while connector owners repair their interfaces. Clear responsibility prevents failures from bouncing between teams indefinitely.
Evaluate realistic end-to-end cases
Include ambiguous account matches, stale CRM notes, missing ERP dates, unauthorised recipients, duplicate events, and a message timeout after possible submission. Check the final state in each system.
Assess the draft's factual support and the agent's tool choices separately. A well-written message can still be based on the wrong order or an outdated note.
Test the permission boundary directly using invalid or forbidden tool arguments. The service should reject them regardless of whether the model would normally generate them.
Reevaluate after changes to connector schemas, business mappings, prompts, or models. The integration contract includes meaning and behaviour, not only whether the HTTP request still succeeds.
## Agree on a connector contract with each system owner
A connector contract should identify supported operations, required permissions, stable identifiers, response meanings, rate limits, and recovery options. Include who communicates changes and who can inspect failed requests.
Pay particular attention to asynchronous operations. One system may return success when work is queued, while another uses success only after the record is updated. The integration should preserve those meanings rather than normalise both into completed.
Keep representative examples and error fixtures with the adapter. When a vendor changes a field or the business changes a status definition, the team can test the affected contract before the agent encounters it in a live case.
Review licensing and supported-use constraints through the responsible owner where they affect the integration. A technically reachable endpoint is not necessarily a supported production interface.
Avoid turning cross-system summaries into hidden policy
A summary may combine relationship notes, order facts, and an email request. It should not create a new business rule merely because the model writes that the customer qualifies for a particular treatment.
Keep policy decisions in their owning process and represent the summary as evidence preparation. If a person makes an exception, record that decision against the case rather than allowing later runs to infer a general precedent.
When the summary reveals a conflict between teams, route the unresolved question to the appropriate owner. Repeatedly changing the wording to make the records sound consistent hides the problem instead of resolving it.
This boundary is especially useful during pilot reviews. Ask staff which statements are confirmed facts, which are interpretations, and which require authority. Any sentence that cannot be classified clearly deserves closer inspection.
Release one useful coordination path
Begin with a read-and-draft workflow that gives staff a verified order-status package. Measure time to prepare an accepted update and the effort required to resolve exceptions.
Keep the manual systems usable and provide a pause control for the new workflow. When resumed, the integration should recognise manual changes through authoritative state rather than assuming its earlier view is still current.
Once the first path is dependable, add a narrow approved write and test its recovery separately. The durable value comes from making cross-system work coherent and inspectable, with AI helping interpret the case while the application preserves authority and confirmed outcomes.