Machine Learning pathway increased my salary by 40%
Enterprise Integration, APIs, MCP, A2A and Cross-System Automation
An agent is only as useful as the systems it can reach, and only as safe as the reach it is denied. Integration is where capability and risk are decided together.
This chapter covers the integration architecture that agentic automation depends on: API-first design across REST, GraphQL and SOAP; webhooks and event-driven communication; the ESB and iPaaS patterns that already exist in most estates; MCP clients, servers, tools and resources; agent-to-agent protocols, discovery and capability negotiation; and integration with ERP, CRM, HRMS, ITSM, finance, document and legacy systems. It closes with the transaction disciplines — authentication, authorisation, rate limiting, mapping, retries, idempotency and integration testing — that separate a working integration from an operable one.
What this covers
- Who this is for
- Integration architects, ERP and platform engineers, security engineers reviewing agent access, and delivery leads responsible for cross-system automation.
- What it assumes
- Chapters 01 to 04, and practical familiarity with HTTP APIs and message-based integration.
- What you will be able to do
- Choose an integration pattern per system, design a governed tool surface for agents, apply least-privilege authorisation across systems, specify idempotent cross-system transactions, and test integrations for failure rather than only for success.
- Reading time
- About 27 minutes including the question bank and glossary.
Integration patterns and when each applies
Synchronous request-response is the simplest and most common: the agent calls an API and waits. It suits reads and short writes where latency is acceptable and the dependency is reliable. Its weakness is coupling — a slow or failing system stalls the agent, and retries can cascade. Timeouts and circuit breakers are mandatory rather than optional.
Asynchronous messaging decouples the agent from the system: the agent publishes an intent, the integration layer executes it and returns a correlated result. This is the right pattern for long-running writes, for systems with variable latency, and for anything that must survive a restart. It requires correlation identifiers and idempotency to be designed, not assumed.
Event-driven integration inverts the direction: systems emit events and the agent reacts. This is how agents participate in real business rhythm — a payment settled, a shipment delayed, a ticket escalated. Batch and file-based integration remains relevant for mainframe and legacy systems, where the practical approach is a scheduled extract that an agent can query, or an RPA robot that performs the interaction deterministically.
| Pattern | Use when | Failure to design for |
|---|---|---|
| Synchronous API | Reads, short writes, tight latency budget | Timeout cascade, retry storms |
| Async messaging | Long writes, variable latency, durability required | Duplicate delivery, lost correlation |
| Event-driven | Reacting to business events in near real time | Out-of-order events, replays |
| Batch / file | Legacy and mainframe systems | Staleness, reconciliation gaps |
| UI automation (RPA) | No API available and none planned | Interface change breaks the robot |
Designing an MCP server that survives a security review
A Model Context Protocol server exposes tools and resources to a model-facing client. The design decisions that matter are what is exposed, who may call it, and what it records. Expose the minimum: a query tool rather than a general SQL tool, a create-invoice tool rather than an unrestricted ERP connector, a read-document tool with server-side permission checks rather than a raw file path.
Authorisation belongs on the server. The server must authenticate the calling agent, check the scope of the specific tool against that agent's role, apply data-level rules, and record the action. Never trust the client's claim about who it is or what it may do; the client is the least trustworthy component in most agent architectures because it is the one running model-driven decisions.
Resources should carry metadata that helps the model use them correctly and helps audit reconstruct what happened: source system, version or last-modified time, classification level, and the scope under which the content was retrieved. A resource without provenance is a grounding claim you cannot check.
- One server per system of record, exposing a curated tool set per consuming agent cohort.
- Server-side authentication and authorisation for every call; client assertions are not evidence.
- Typed schemas with range and enum constraints on all arguments.
- Provenance metadata on every resource: source, version, classification, retrieval scope.
- Full call logging with caller identity, tool, arguments hash and result status.
An MCP server that wraps a database with a generic query capability is equivalent to giving the agent a database login. The review should reject it on sight.
Agent-to-agent communication, discovery and negotiation
Agent-to-agent protocols matter when agents are built by different teams, in different vendors, or across organisational boundaries, and must exchange work without bespoke glue. The core elements are capability discovery — what an agent can do and under what terms — authenticated identity for each participant, a task exchange with a declared schema, and a record of the delegation.
Capability negotiation is where most of the practical value sits, and most of the risk. An agent that claims a capability it performs unreliably will attract work it fails. Declarations therefore need to be backed by evaluation evidence: the scope of the task class, the measured success rate on that class, and the escalation path when it declines.
Cross-organisational agent interaction raises the stakes. Two companies exchanging work through agents need mutual authentication, agreed schemas, liability terms and an auditable record of every exchange. This is closer to establishing a B2B interface than to calling an internal API, and should be governed as such — including contract terms, not only technical integration.
Integrating ERP, CRM, HRMS, ITSM and finance systems
ERP integration is the hardest and the most valuable. Systems such as SAP and Oracle carry master data, transactional integrity and long approval chains. The practical rule is that agents read broadly and write narrowly: query tools for documents and records, and a small number of highly constrained transactional tools for actions such as creating a purchase requisition or posting a goods receipt, each with its own authorisation and validation.
CRM integration, typically Salesforce or Microsoft Dynamics, is more forgiving for reads and richer for context. Agents summarise account history, draft follow-ups and flag risk. Writes should be limited to clearly attributable actions — a logged interaction, a task, a note — with the agent identity visible in the record so a human reading the CRM can tell what a machine wrote.
HRMS and HCM systems such as Workday hold personal data with strict purpose limitation. Agent access should be scoped by purpose and role, with field-level restriction rather than record-level, and with logging that satisfies privacy obligations. ITSM systems such as ServiceNow are the natural home for agent-driven resolution, but change management actions must stay behind human approval. Finance and accounting integration demands idempotency above all: duplicate postings are expensive to unwind and damaging to trust.
- Read broad, write narrow
- Expansive query capability with a deliberately small, individually authorised transactional surface.
- Attributable write
- A write that records the agent identity and version, so a human can see what was machine-authored.
- Purpose-scoped access
- Access limited by the reason for processing, not only by role, particularly for HR and personal data.
- Posting idempotency
- A key and verification scheme preventing duplicate financial entries on retry.
Cross-system transactions, retries and idempotency
Distributed transactions across ERP, CRM and finance cannot rely on two-phase commit; in practice the pattern is a saga: a sequence of local transactions with defined compensating actions for each step. An agent that creates a purchase requisition and then fails to reserve budget must trigger a compensation that cancels the requisition, or the process must record the orphaned state for reconciliation.
Idempotency is the discipline that makes retries safe. Every write carries a key derived from the case and the intended action; the receiving integration layer records the key and returns the original result on repeat. Where the downstream system cannot support this natively, the integration layer must maintain the mapping — and if it cannot, the action must not be retried automatically.
Rate limits, quotas and back-pressure are operational realities. Agents can generate bursty traffic precisely because they retry, fan out and loop; integration layers must throttle per agent and per system, with informative errors that the agent can act on rather than opaque failures it will retry indefinitely.
| Step | Local action | Compensation |
|---|---|---|
| 1 | Create requisition in ERP | Cancel requisition |
| 2 | Reserve budget | Release reservation |
| 3 | Create supplier record linkage | Unlink supplier reference |
| 4 | Raise approval task | Close task with reason |
| 5 | Notify requester | Send corrected notice |
Integration testing, mapping and error handling
Integration tests must cover failure, not only success. The minimum suite includes: an unavailable dependency, a timeout, a duplicate delivery, a schema change with an unexpected field, a rate-limit response, a permission denial, and a partial write that requires compensation. These are the conditions under which agent behaviour determines whether the business process is safe.
Data mapping deserves its own artefact. Field-level mapping between the agent's structured output and the target system's model — including transformations, defaults, validation rules and known lossy conversions — should be documented and tested, because silent mapping errors produce correct-looking records with wrong values, which are the most expensive defects to find.
Error handling should distinguish retryable from terminal conditions and surface that distinction to the agent. A 429 with a retry-after is retryable; a validation rejection is terminal and needs correction or escalation; an authentication failure needs a human. An integration that returns a generic error leaves the agent to guess, and it will usually guess wrong.
Simulate a write that succeeds at the target system but fails on the response path. If your process cannot detect and reconcile that, it will eventually double-post.
Authorisation, secrets and integration governance
Every agent that writes must have its own identity. Shared credentials destroy attribution and make least privilege impossible. Secrets should be issued per agent, short-lived where supported, scoped to the tools the agent uses, rotated on a schedule, and never embedded in prompts or configuration files that reach a model.
Authorisation should be evaluated at the tool boundary against three things: the calling agent's declared role, the specific capability requested, and the data classification of what is being touched. That triple check is what stops a broadly-scoped agent from reaching sensitive records through an otherwise legitimate tool.
Governance needs an inventory: which agents can reach which systems, through which tools, with which scopes, owned by whom, reviewed when. Without it, permission creep is invisible — each addition looks reasonable in isolation and the aggregate becomes unacceptable. The inventory should be generated from configuration rather than maintained by hand, or it will drift within weeks.
Key focus areas
- Pattern selection
- Synchronous, asynchronous, event-driven, batch and UI automation, matched to system characteristics.
- API-first design
- Treating the tool surface as a designed product with schemas, scopes and documented behaviour.
- MCP server design
- Curated tool exposure, server-side authorisation, provenance metadata and full call logging.
- Delegation records
- Who asked which agent to do what, with which scope, for every A2A exchange.
- Capability evidence
- Declared agent capabilities backed by measured success rates and escalation paths.
- Read broad, write narrow
- The ERP rule: generous query, individually authorised transactions.
- Attributable writes
- Agent identity recorded in the target system so machine authorship is visible.
- Purpose-scoped access
- HR and personal data access limited by reason for processing, with field-level restriction.
- Saga compensation
- Defined reversal or offset for each step of a multi-system transaction.
- Idempotency keys
- Keys derived from case and intent so retries return the original result instead of duplicating it.
- Back-pressure
- Per-agent and per-system throttling with actionable error responses.
- Failure-first testing
- Timeouts, duplicates, schema drift, denials and partial writes tested as first-class cases.
- Mapping artefacts
- Documented field mappings including transformations, defaults and known lossy conversions.
- Access inventory
- Generated record of agent-to-system reach, scopes and owners, reviewed on a schedule.
Key takeaways
- Choose the integration pattern from the system's characteristics, not from convenience.
- Synchronous calls need timeouts and circuit breakers or they become cascading failures.
- MCP standardises the interface; least privilege is decided by what the server exposes.
- Authorise on the server for every call; never trust the client's assertion of identity.
- Wrap systems with specific tools, not with general query capability.
- Attach provenance to resources so grounding claims can be checked.
- A2A capability claims need evaluation evidence, or work flows to unreliable agents.
- Read broadly, write narrowly — especially in ERP.
- Make agent writes attributable in the target system.
- Scope HR and personal data access by purpose, with field-level restriction.
- Cross-system correctness requires saga compensations, not distributed transactions.
- Idempotency is what makes retries safe; without it, escalate rather than retry.
- Throttle per agent and per system, and return errors the agent can act on.
- Test failure conditions as first-class cases, including a write that succeeds but whose response is lost.
- Maintain a generated access inventory or permission creep becomes invisible.
Glossary
- Back-pressure
- Signalling from a downstream system that it cannot accept more load, with defined caller behaviour.
- Circuit breaker
- A pattern that stops calling a failing dependency for a period to prevent cascading failure.
- Compensation
- An action that offsets a previously committed step in a saga.
- Correlation id
- An identifier linking a request to its asynchronous response.
- ESB
- Enterprise Service Bus — a central integration layer routing and transforming messages between systems.
- iPaaS
- Integration Platform as a Service — managed connectors and flows between cloud and on-premise systems.
- Idempotency
- The property that repeated identical requests produce a single effect.
- MCP client
- The model-facing component that discovers and calls tools exposed by an MCP server.
- MCP server
- The governed endpoint exposing declared tools and resources for a system of record.
- Provenance
- Source, version and scope metadata attached to retrieved content.
- Rate limiting
- Enforced throughput ceilings per caller or system.
- Saga
- A multi-step transaction coordinated by compensations rather than distributed locking.
- Schema drift
- A downstream change in data structure that breaks an integration contract.
- Scope
- The specific capability and data range an agent identity may exercise.
- Service account
- A non-human identity; acceptable for a single agent only if uniquely issued to it.
- Throttling
- Deliberate slowing of callers to protect a system and preserve fairness.
- Tool surface
- The complete set of capabilities exposed at a boundary, considered as a security design.
- Webhook
- An inbound HTTP callback delivering an event to a registered endpoint.
- Write attribution
- Recording which agent, version and case produced a write in the target system.
- Capability negotiation
- Establishing what an agent can do, under what terms, before work is assigned.
5 questions to test the model
What is the strongest objection to exposing a generic SQL query tool to an agent?
Which pattern should be used for a long-running write to a system with variable latency?
A purchase requisition is created but budget reservation fails. What is required?
Where should authorisation for an MCP tool call be enforced?
Which test most often exposes unsafe integration behaviour?
Questions this page answers
Should agents call APIs directly or through an integration layer?
How do we integrate a system with no API?
Do we need MCP if we already have APIs?
How should agent credentials be managed?
What is the minimum viable authorisation model?
How do we handle duplicate webhook delivery?
What should an integration error return to an agent?
How do we keep mappings from drifting?
Do agents need to write to the ERP at all?
How do we make writes attributable in systems with one service account?
What about SOAP and older XML interfaces?
How do we test integrations continuously?
Is a knowledge graph necessary for integration?
How do we throttle agents fairly?
What is the right way to handle partial failures in a multi-system process?
How do we govern cross-organisational A2A interactions?
What monitoring belongs on integrations specifically?
How do we onboard a new system quickly?
What is the most expensive integration error to detect?
How does this chapter connect to Chapter 06?
What does Synchronous API mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integration patterns and when each applies)?
What does Async messaging mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integration patterns and when each applies)?
What does Event-driven mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integration patterns and when each applies)?
What does Batch / file mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integration patterns and when each applies)?
What does UI automation (RPA) mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integration patterns and when each applies)?
What does Read broad, write narrow mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integrating ERP, CRM, HRMS, ITSM and finance systems)?
What does Attributable write mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integrating ERP, CRM, HRMS, ITSM and finance systems)?
What does Purpose-scoped access mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integrating ERP, CRM, HRMS, ITSM and finance systems)?
What does Posting idempotency mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Integrating ERP, CRM, HRMS, ITSM and finance systems)?
What does 1 mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Cross-system transactions, retries and idempotency)?
What does 2 mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Cross-system transactions, retries and idempotency)?
What does 3 mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Cross-system transactions, retries and idempotency)?
What does 4 mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Cross-system transactions, retries and idempotency)?
What does 5 mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Cross-system transactions, retries and idempotency)?
What does Pattern selection mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
What does API-first design mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
What does MCP server design mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
What does Delegation records mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
What does Capability evidence mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
What does Read broad, write narrow mean in Enterprise Integration, APIs, MCP, A2A and Cross-System Automation (Key focus areas)?
Sources and standards
- Model Context Protocol — server and client concepts
Tool and resource surface design used throughout this chapter.
- SAP Integration Suite documentation
Enterprise integration patterns and API management for ERP landscapes.
- Salesforce APIs and integration overview
CRM integration patterns referenced in the systems section.
- ServiceNow developer documentation
ITSM integration and change management controls.
- OWASP API Security Top 10
Authorisation, rate limiting and object-level access risks.
- Google A2A protocol overview
Agent-to-agent capability discovery and delegation direction.
Continue through the twelve chapters
With integration in place, Chapter 06 applies it function by function — finance, procurement, HR, service, legal, risk and operations — with the cases and KPIs each function will actually be judged on.
Continue this lesson with a subscription
Multi Agentic Enterprise Workflow Automation is part of the paid catalogue. You have read the free preview. A subscription opens the rest of this lesson, the classroom slides and the assessment questions.
- The full lesson for this topic and every other catalogue topic
- Every classroom slide deck and worked example
- All assessments, with a verifiable certificate on completion
The Free-To-Learn library stays open to everyone and is not affected by this.
