Event-Driven ERP Integration: Architecture That Holds Up
event-driven architecture for ERP integration how to design it
Also searched as
- ERP events Kafka integration pattern
- outbox pattern ERP integration
- ERP webhooks vs polling
- publish ERP business events to other systems
Short answer
Use events when several systems must react to ERP changes quickly and you want to stop polling. Get events from the ERP's native mechanism where one exists, otherwise from change data capture, and design every consumer to be idempotent and tolerant of reordering. Keep the ERP as the system of record and treat events as notifications, not as the ledger.
Applies to: ERPs with native eventing (Infor ION BODs, SAP Event Mesh and business events, Dynamics 365 business events, Oracle Fusion business events, NetSuite SuiteScript user events) and any ERP via CDC.
How to design event-driven ERP integration
- 1Identify the events the business actually needs: sales order released, receipt posted, work order completed, item changed. Resist publishing every table change.
- 2Find the ERP's native event source first: ION BODs on Infor, SAP business events through Event Mesh, Dynamics business events, Oracle Fusion business events, or a SuiteScript user event or workflow that calls out from NetSuite.
- 3If no native source exists, capture changes with log-based CDC, or write events to an outbox table in the same database transaction as the business change and publish from it.
- 4Publish to a broker with durable storage: Kafka, RabbitMQ, Azure Service Bus, AWS SNS/SQS or the vendor's own bus. Choose retention long enough to replay after a consumer bug.
- 5Define a stable event contract with an ID, type, version, timestamp, entity key and a minimal payload. Prefer sending the key and fetching current state from the ERP when freshness matters.
- 6Make consumers idempotent: store processed event IDs or use natural idempotency keys, so duplicate delivery never creates a second order or receipt.
- 7Handle ordering explicitly. Partition by entity key where ordering matters, and use version or timestamp checks to discard stale updates.
- 8Add a dead-letter queue, alerting on lag and a replay procedure, and test them before go-live.
Where ERP events come from
Native events are the safest source because the ERP decides when a business change is complete. Infor ION distributes BODs (Business Object Documents) through its messaging layer, SAP exposes business events that can flow through SAP Event Mesh or Integration Suite, and Dynamics 365 Finance and Operations has a business events framework that targets Service Bus, Event Grid or HTTPS endpoints. Check which of your transactions are actually covered, since coverage is rarely complete.
Where coverage is thin, log-based CDC (Debezium on SQL Server, Oracle or PostgreSQL) emits row-level changes with low overhead. The catch is semantics: a row change is not a business event. A sales order release may touch six tables across several commits, so you need logic to assemble the row changes into one meaningful event.
Cloud SaaS ERPs without database access, such as NetSuite, rely on in-product hooks: a User Event script on aftersubmit, a workflow action or a scheduled saved search that calls an external endpoint. Remember governance limits and make the callout asynchronous, because a slow external call inside the transaction slows every user.
The outbox pattern and why dual writes fail
A common mistake is to update the ERP and then publish a message in application code. If the process dies between the two steps, the ERP changed but no event was sent, or the reverse. This dual-write problem is why events silently disappear in production and why finance and the warehouse drift apart.
The transactional outbox fixes it. Write the business change and an outbox row in the same database transaction. A separate relay reads the outbox and publishes to the broker, marking rows sent. Delivery becomes at-least-once, which is why consumers must be idempotent. This pattern fits custom extensions on ERPs where you control a database, such as customisations on SyteLine or Dynamics.
For packaged ERP code you cannot modify, the equivalent is to treat the vendor's own change log or CDC stream as the outbox and build the relay around it.
-- Outbox table written in the same transaction as the business change CREATE TABLE integration_outbox ( event_id UNIQUEIDENTIFIER PRIMARY KEY, event_type VARCHAR(80) NOT NULL, entity_key VARCHAR(80) NOT NULL, payload_json NVARCHAR(MAX) NOT NULL, created_at DATETIME2 DEFAULT SYSUTCDATETIME(), sent_at DATETIME2 NULL );
Consumers: idempotency, ordering and replay
Brokers deliver at least once, so duplicates will happen. Give every event a unique ID and have the consumer record processed IDs, or key downstream writes on a natural identifier such as the external order number so a repeat is a no-op. Without this, a retry after a timeout creates duplicate receipts.
Ordering is weaker than most designs assume. Kafka preserves order only within a partition, so partition by the entity key. Even then, include a version or modified timestamp and ignore updates older than what you already applied. For the highest-value flows, send only the key and have the consumer read the current ERP state.
Plan for replay. When a consumer has a bug, you will want to reprocess a week of events. That requires retention, deterministic consumers and a way to mark side effects, such as emails or ERP postings, so replay does not repeat them.
Common pitfalls
- !Publishing from application code after the ERP commit. A crash between the two creates silent data loss; use an outbox or native events.
- !Treating row-level CDC as business events. Consumers then see half-complete transactions and must reconstruct meaning themselves.
- !Making the ERP callout synchronous. A slow external endpoint blocks users and can hit governance or timeout limits.
- !Assuming exactly-once delivery. Design every consumer for duplicates and out-of-order arrival.
- !Fat payloads that duplicate ERP state. Stale copies cause conflicts; send keys and fetch when freshness matters.
- !No dead-letter queue or lag alerts. Failures sit unnoticed until a department notices missing data.
How an ERP-grounded AI assistant handles this
Events also help AI assistants stay current without constant polling, for example refreshing an index or cache when an item or order changes. ERPray reads live ERP data in read-only mode and shows the query it ran, so event feeds are an optimisation for retrieval freshness, not a requirement. Any action an agent proposes still goes through human approval before it writes through the ERP's API.
Frequently asked questions
Is event-driven integration worth it for a mid-sized manufacturer?
Often not at first. If a few systems exchange data on a schedule, scheduled sync with good monitoring is simpler. Events pay off when several consumers need to react quickly to the same changes, or when polling load on the ERP becomes a problem.
Do I need Kafka for ERP events?
Not necessarily. A managed queue or the ERP vendor's bus (Infor ION, SAP Event Mesh, Azure Service Bus) can handle moderate volumes. Choose Kafka when you need replayable history, high throughput or many independent consumers, and have the skills to operate it or buy it managed.
How do I get events out of NetSuite?
Use a User Event script on aftersubmit, a workflow, or a scheduled saved search to send an asynchronous callout or to write to a queue. Mind governance units and avoid blocking the user transaction. Alternatively poll with SuiteQL on a last-modified field for lower-priority flows.
What is the difference between CDC and business events?
CDC emits row-level changes from the database log. A business event represents a completed business fact such as order released. One business event can span many row changes, so CDC needs assembly logic. Native ERP events are usually closer to business meaning but have narrower coverage.
Related
ERP Integration Architecture: API vs iPaaS vs ETL
Choose by what the data does, not by tool preference. Use the ERP's own API (or its native bus) for transactional writes that must be validated by ERP business logic, ETL or change data capture for bulk analytical reads, and an iPaaS when you have many endpoints, need monitoring and retries, and lack the staff to run your own middleware. Most real estates need two of the three.
CIO briefingData Platform for ERP Data: Replica, Warehouse or Lakehouse
Start with the smallest thing that removes reporting load from the ERP: a read replica or vendor replication feed. Add a warehouse or lakehouse when you must join ERP data with other sources, keep history, or serve many consumers. Put a governed semantic layer on top, because raw ERP tables are not a usable analytics or AI interface on their own.
CIO briefingBuild vs Buy for ERP Extensions: A CTO Decision Guide
Work down a ladder: configure the standard product, then buy a supported ISV add-on, then build outside the ERP core against its APIs, and only then modify in the core. Each step down raises upgrade risk and lifetime cost. Build only where the capability is a genuine differentiator or no product fits, and keep the code upgrade-safe and owned.
How-toHow to Run an ERP User Access Review (Quarterly Checklist)
An ERP user access review is a recurring control where system owners confirm that every active user, role and privileged permission is still justified. Extract users and roles from the ERP itself, join them to HR status, send each business owner a scoped list to certify or revoke, record the decisions, and execute the removals with ticket evidence.
How-toHow to Test ERP Backup and Disaster Recovery
A backup is only proven when you have restored it and a user has transacted in the restored system. Define RTO and RPO with the business, restore the full ERP stack (database, application, integrations, attachments, secrets) to an isolated environment, run a scripted smoke test, time every step, and record gaps as action items.
How-toERP Patching Cadence: How Often Should You Patch?
Patch the ERP stack in layers on different clocks: operating system and database monthly or quarterly, ERP vendor cumulative updates quarterly or semi-annually, and security fixes on an emergency path measured in days. Test every patch in a sandbox refreshed from production, with a scripted regression and a tested rollback.
AI for ERPAI Agents Over Infor ION API, BODs, and the Infor Data Lake
Build AI agents on Infor ION API Gateway, BODs, and Data Lake, alongside or instead of Infor's own GenAI features, with your choice of model and hosting.
AI for ERPAI for Infor M3: A Practical Path from MI Programs to a Private Assistant
Add grounded AI to Infor M3: natural-language answers over MI programs and MEC, agents for distribution and manufacturing, on-prem or private cloud in Europe.
Stuck on ERP integration (vendor-neutral)?
Talk to engineers who work inside ERP integration (vendor-neutral) every week, and who build private AI that answers these questions from your own ERP data.