Make ERP customer creation asynchronous
Protect the commercial workflow from ERP latency while making pending state and recovery explicit.
Independently created. Contains no employer or client implementation detail, internal names or figures.
01Context
A global B2B organization must validate every new customer financially in ERP before the first order. On a normal day ERP answers in seconds; at month-end close, in maintenance windows or under regional latency it takes minutes—or does not answer. If commercial approval in CRM waits for that answer, sellers stall or click again; if it does not wait, someone has to own what happens while ERP has not yet answered.
02Decision drivers
- D01
A timeout must never produce a second legal customer
- D02
Sellers need a status they can act on while ERP decides
- D03
ERP stays the only issuer of the legal customer number
- D04
Every stuck request needs an owner, a reason and a safe replay
03Options considered
| Option | Right when | Cost / trade-off | Verdict |
|---|---|---|---|
| Synchronous API call at approval | ERP answers within seconds with high availability, and volumes are low | Approval inherits ERP downtime and latency; after a timeout the user cannot tell whether to click again | Rejected |
| Managed asynchronous command | ERP latency varies and outcomes must be recoverable without the user | Pending becomes a real state: CRM must show it, someone must own it and orders must wait for it | Selected |
| Scheduled batch creation | Bulk onboarding where nobody orders on the same day | Hours of invisible delay; rejections arrive detached from the approval that caused them | Rejected |
Every option is right under some premises. The verdict applies to the context above.
04Decision
After commercial approval, CRM freezes the approved data and publishes one idempotent creation command, keyed by the business request. The integration layer validates it, submits it to ERP, persists correlation and delivery state, and returns the outcome to CRM: created, rejected with a reason, or unknown. Order entry opens only when CRM holds the ERP customer number.
05Consequences
What this choice changes elsewhere in the system.
- Business state
CRM shows Pending, Created, Rejected and Intervention required as business states, not as technical log entries.
- Idempotency
The request key travels with every retry, so a replay can never create a second customer.
- Recovery
A timeout is resolved by looking the request up in ERP before any retry (ADR 007); users never press Create again.
- Ownership
Platform operations owns ageing and stuck requests; master data owns the rejections it can repair.
- Observability
Requests are monitored by age and outcome in business terms, not only as failed calls.
- Order entry
Orders are gated on the ERP customer number, so no order can reference a customer that may not exist.
06Revisit when
The decision holds while its context holds. Challenge it when:
ERP exposes an idempotent creation endpoint that answers within the approval interaction, month-end included.
Approval and legal creation become one decision by one owner, so a pending state no longer means anything.
Order entry moves into ERP, so CRM no longer needs to know when the customer exists.
07Where this decision is applied
The decision says why this path was chosen; each case shows how it takes part in a larger architecture.
- Systems case / 01Designing a CRM–ERP customer lifecycleA premise-led architecture: from commercial intent to a legally valid, operationally recoverable customer.
- Systems case / 02Designing the system boundaries behind a global commercial platformDeciding which platform owns each commercial capability—and which boundaries stay in place even when the experience feels like one application.
- Systems case / 03Designing customer and master-data identity across CRM and ERPSeparating commercial, legal and transactional identity—with one issuer, explicit cardinality and governed merges—and giving authority to concepts and attributes rather than whole records.
08Related decisions
Decisions this one depends on, or constrains.
- ADR / 007Treat uncertain integration outcomes as unknown, not failedA timeout says nothing about whether the receiver committed. Model ‘unknown’ as its own state, resolve it by request key, and only then retry or fail.
- ADR / 004Separate commercial approval from financial validationTwo decisions with different owners, evidence and SLAs should not share one approval step—even when one form collects the data for both.
- ADR / 008Run reconciliation as a permanent control, not an exception processDelivery guarantees fail silently. A scheduled comparison of expected and actual populations—with an owner for every kind of difference—is part of the architecture, not cleanup.
- ADR / 005Separate commercial identity from legal customer identityAn account is a commercial relationship; a legal entity is a registered organization; an ERP customer is that entity in one of our companies. Model three linked identities—not one record that means all of them.