14.3 Workflow, rules, events
Workflow engine
Section titled “Workflow engine”- MVP: Camunda 7 embeddable in JVM monolith. BPMN models for sanction-to-disbursement saga, application lifecycle, collection cycle, settlement.
- Scale: Temporal for code-first durable workflows.
See 5.5 Workflow and rules engines for selection rationale.
Rule engine
Section titled “Rule engine”- MVP: decision tables in DB + JSON Logic for rule expressions. Sandbox testing via clone DB. Versioned.
- Scale: Drools when complexity demands.
Event bus
Section titled “Event bus”- MVP: RabbitMQ.
- Scale: Kafka with schema registry.
Queue / async workers
Section titled “Queue / async workers”- Spring Cloud Stream or Spring AMQP for RabbitMQ.
- Spring Kafka for Kafka.
- Idempotency patterns: outbox + dedupe.
- DLQ for permanent failures with inspection UI.
Saga orchestration
Section titled “Saga orchestration”- Camunda / Temporal for multi-step sagas.
- Local Java state machines (Spring Statemachine) for in-service flows.
ML platform
Section titled “ML platform”- Year 1: defer.
- Year 2+:
- Feast (or homegrown on warehouse) as feature store.
- MLflow for experiment + model registry.
- Training: Python notebooks → MLflow.
- Serving: Java-side via ONNX runtime or via a Python serving service called from Java.
- Monitoring: Evidently / Arize / homegrown dashboards.
Notification service
Section titled “Notification service”- Cross-cutting, low-level shared service.
- Backends: SMS, WhatsApp, email, push, IVR.
- Templates centrally managed; multi-language.
Scheduler
Section titled “Scheduler”- Spring
@Scheduledfor in-process. - Quartz or K8s CronJob for distributed scheduled.
- Daily classification, daily NACH, monthly bureau, etc.