Summary
This project addresses the architectural challenge of maintaining reliable bi-directional data synchronisation between Salesforce Sales Cloud and an external Enterprise Resource Planning (ERP) database, avoiding manual data re-entry and latency bottlenecks.
Note: This is an illustrative reference case study demonstrating technical capabilities and architecture patterns. Real customer names and proprietary data are withheld.
The Problem
Sales and fulfilment teams relied on two disparate systems: customer accounts and deal stages lived in Salesforce, while order processing, inventory levels, and invoice generation were handled in an external ERP.
Manual export and import processes caused recurring issues:
- Data drift and record discrepancies across teams.
- Significant delays in sales reps receiving invoice status updates.
- Inconsistent inventory figures leading to quoting errors on backordered items.
The Solution
An event-driven middleware architecture was designed using secure REST endpoints and lightweight background workers:
- Outbound from Salesforce: Custom Apex triggers publish platform events on order finalisation, pushing encrypted payloads to a secured REST gateway.
- ERP Ingestion: A lightweight intermediary worker validates payloads against strict OpenAPI schemas and queues batch updates into the ERP database.
- Inbound to Salesforce: Webhook callbacks notify Salesforce of order fulfilment and invoice generation, immediately updating status flags on related Opportunity records.
Implementation Details
- Custom Apex Classes: Modular Apex services built with strict governor limit adherence and bulkified trigger handlers.
- Resilient Retry Queue: Failed webhook deliveries are recorded in an idempotent dead-letter queue with exponential backoff rather than failing silently.
- Security: OAuth 2.0 mutual authentication, TLS 1.3 encryption, and scoped access tokens ensuring least-privilege API access.
- Testing: Over 90% unit test coverage in Apex with comprehensive mock HTTP callout fixtures.
Key Technologies
- Salesforce Apex: Custom REST controllers, Change Data Capture triggers, and asynchronous queueable jobs.
- Node.js & TypeScript: Intermediary webhook receiver and payload transformation worker.
- Docker: Containerised runtime for the intermediary service with minimal memory overhead.