ADR-00032 — Temporal vs. Camunda for Checkout Saga Workflow Orchestration
- Status: Approved / Implemented
- Date: 2026-10-08
- Authors: Engineering Team
Context
ADR-00011 already settled Go as this platform’s default backend language, including the Temporal SDK’s availability as one of the deciding factors for that choice, and already rejected Java (including GraalVM-compiled Java) as the default runtime on startup-cost/baseline-memory grounds. This ADR is narrower and sits one level below that one: given that order-service needs a durable workflow-orchestration engine to run the checkout saga (BRD-013 BR-04, SR-014 FR-01), which workflow-orchestration engine should host it — Temporal, the engine actually implemented today, or Camunda, a BPMN-based process engine a team building this kind of checkout saga would realistically have evaluated. Camunda is not present anywhere in this codebase; it is evaluated here only as the rejected alternative, reasoned about on its own documented runtime characteristics, not against any Camunda code that exists in this repo.
Decision Drivers (FRs & NFRs)
See SR-014 and SR-018 for the full requirement lists.
- SR-018 FR-01 (Retry, Durable-Timer, and Signal Primitives MUST Be Supplied by the Coordination Engine): whichever engine is chosen must supply these as built-in guarantees, not bespoke application code — see BRD-017 BR-01.
- FR-01 (Order Creation Schedules, Never Executes, the Saga): order creation MUST schedule a durable workflow that sequences inventory reservation, payment capture, and shipment creation — the engine must support long-running, crash-recoverable execution, not just a single request/response call.
- NFR-01 (Saga Execution Requires Its Own Running Worker): the chosen engine’s worker process is load-bearing infrastructure for every checkout — its startup/resource cost multiplies across every environment and every scaling event.
- An officially supported SDK in the platform’s own default language. ADR-00011 already established that Go is this platform’s default backend language and that only Go has an official Temporal SDK in this ecosystem (see the platform’s cross-cutting principles capability table) — any engine considered here is weighed against that same constraint.
- BR-09 (BRD-013 — Every Step Is Tracked, and Any Failure Is Visible and Attributable): whichever engine is chosen must make the saga’s own execution history durable and queryable, not just “eventually correct.”
Options Evaluated
Option 1 — Temporal, Go SDK (CHOSEN)
order-service schedules and executes CheckoutSagaWorkflow (order-service’s workflow/checkout_saga_workflow.go) as code — a plain Go function orchestrating typed activity calls — on Temporal’s open-source workflow engine, run via a dedicated cmd/worker binary polling task queue checkout-queue.
- Pros:
- Workflows are written as ordinary Go functions, not an external BPMN diagram/XML file.
CheckoutSagaWorkflow’s step sequence (ReserveInventoryActivity→CreatePaymentOrderActivity→ wait-for-signal-or-timeout →executeCreateShipment→consumeInventory→StepCompleted) and its compensation branches (releaseInventory,refundPayment) are plain conditional Go code, reviewed and tested the same way as any other service code in this monorepo — no second modeling tool or DSL to learn, version, or keep in sync with the code that actually executes it. - No separate server-side process engine to operate. Temporal’s worker is a Go binary this platform already knows how to build, deploy, and scale (the same
cmd/workershape every Go service in this platform could in principle have); there is no JVM-based process-engine server to size, patch, and keep available as a prerequisite for every checkout. - One language, one SDK, no cross-language bridge.
order-serviceis already Go, per ADR-00011 — Temporal’s official Go SDK (pkg/temporal/ingo-lang-core-lib,coretemporal.NewTemporalClient/WithActivitySpan[T]) lets the saga’s orchestration code, its activity implementations, and the rest of the service share one build, one binary family, one deployment pipeline, and one core-lib tracing/logging convention. - Durable execution and retries are intrinsic to the SDK, not bolted on.
workflow.ActivityOptions{RetryPolicy: &temporal.RetryPolicy{MaximumAttempts: 3}}andworkflow.NewTimer/workflow.GetSignalChannelare standard SDK primitives already used by every activity incheckout_saga_workflow.go— see ADR-00034 for the full detail on what this buys over hand-written coordination.
- Workflows are written as ordinary Go functions, not an external BPMN diagram/XML file.
- Cons & Accepted Trade-offs:
- No visual BPMN process diagram for a non-engineer stakeholder to read. The saga’s step sequence is legible only by reading Go code (or this platform’s own Architecture docs) — accepted because this platform’s actual readership for “how does checkout work” is engineers, not business-process analysts, and the Engineering Doc Pipeline’s own Architecture stage already exists to document the flow in diagram form for anyone who needs it (see Architecture-00014).
- A second piece of infrastructure (the Temporal cluster itself) is still required, even though it’s lighter than Camunda’s — this platform’s own
development/docker-compose.ymlruns atemporalservice (frontend, gRPC, port7233) andtemporal-uialongside the already-running Postgres instance it reuses, not an entirely separate database. This is the same NFR-01 operational-surface trade-off ADR-00027 already accepted for choosing an asynchronous saga design at all — this ADR does not re-litigate that choice, only which engine implements it.
Option 2 — Camunda (BPMN process engine)
Model the checkout saga as a BPMN process diagram (reserve inventory → capture payment → create shipment, with compensating boundary events for rollback) and run it on Camunda’s process engine — either Camunda Platform 7 (a JVM-embedded or standalone Java engine) or Camunda Platform 8 (Zeebe, a distributed Java-based runtime).
- Pros:
- A BPMN diagram is directly readable by a non-engineer business stakeholder — the process model itself doubles as documentation in a way Go code does not.
- Mature, widely adopted BPM tooling with a large existing ecosystem of connectors, forms, and a dedicated process-monitoring UI (Camunda Cockpit/Operate).
- Built-in compensation-event modeling (BPMN’s native “compensating activity” construct) maps conceptually onto the same rollback idea
releaseInventory/refundPaymentalready implement in code.
- Cons (Why Rejected):
- Camunda’s runtime is Java/JVM-based, and this platform has already rejected Java as a backend runtime on exactly these grounds. ADR-00011’s Option 2 (Java, including GraalVM-compiled Java) documents the specific, accepted reasons: a standard JVM pays a class-loading/JIT warm-up cost on every fresh instance, directly limiting how fast new capacity can absorb a load spike (the exact concern BRD-007’s BR-02 flags); and GraalVM native-image compilation, which would remove most of that warm-up cost, narrows Camunda’s own ecosystem advantage (not every Camunda connector/plugin supports native-image compilation cleanly) and adds a multi-minute ahead-of-time compilation step to the build pipeline, against this platform’s existing few-second Go build times. Camunda would reintroduce the identical runtime-footprint problem this platform already decided against, for a workflow-orchestration need that Go’s own Temporal SDK already satisfies.
- No official Camunda SDK for Go. Integrating
order-servicewith a Camunda engine would mean driving it through Camunda’s REST API (Platform 7) or its gRPC gateway (Zeebe/Platform 8) from Go — a client-library-less integration this platform would have to hand-roll and maintain itself, rather than consuming a first-party SDK the waypkg/temporal/already wraps Temporal’s official Go SDK. - Reintroduces a second backend runtime without this platform’s one accepted justification for adding one. ADR-00010 and ADR-00011 already establish that a second backend language/runtime is only justified when a workload’s dominant constraint genuinely needs it — Rust for memory-safety-critical secret handling is the one accepted case. A JVM-based process engine running alongside nine Go services and eight Rust services, purely to host one workflow, adds a third runtime for a need Go’s own Temporal SDK already meets natively.
- BPMN’s compensation model still needs to call the same Go-service RPCs either way. Modeling
releaseInventory/refundPaymentas BPMN compensating activities doesn’t remove the need to implement the actual compensating logic as a call intoinventory-service/payment-service— it only relocates where the sequencing of that logic lives, from Go code co-located with the rest of the service to an external process definition in a different system, which is a net increase in the number of places a reviewer has to look to understand one saga’s behavior. - Operationally heavier for the gain. A Camunda engine (Platform 7’s embedded/shared-process-engine model, or Platform 8/Zeebe’s distributed brokers-plus-gateway topology) is a materially larger piece of infrastructure to run, patch, and scale than Temporal’s own server, for a platform whose entire checkout-saga surface today is one workflow type with a handful of steps.
Final Decision
Option 1 is selected and implemented. order-service’s checkout saga runs on Temporal, consumed through its official Go SDK and this platform’s own pkg/temporal/ wrapper, staying inside the single-backend-language boundary ADR-00010/ADR-00011 already drew around Go, and avoiding the JVM startup/memory cost this platform already rejected when it chose Go over Java as its default runtime. Camunda remains a credible choice for a team whose process needs a business-stakeholder-readable BPMN diagram or whose backend runtime is already JVM-based — neither is true here.
Related Documents
- BRD-013 — Checkout Completion: Real Payment Capture and Reliable Fulfillment Handoff
- BRD-017 — Dependable, Auditable Coordination of Multi-Step Order Transactions
- SR-014 — Checkout Completion: Payment Capture & Fulfillment Handoff System Requirements
- SR-018 — Dependable, Auditable Multi-Step Order Transaction Coordination: System Requirements
- ADR-00010 — Polyglot Language & Runtime Selection
- ADR-00011 — Go vs Java vs Node: Default Backend Runtime
- ADR-00027 — Asynchronous Saga + Webhook Relay vs. Synchronous Payment Capture for Checkout Completion
- ADR-00033 — Saga/Orchestration vs. Choreography for Checkout Distributed Transaction Coordination
- ADR-00034 — Temporal SDK vs. Hand-Built Saga Coordination Code
- Architecture — Checkout Saga Orchestration Pattern & Audit Trail
- Coding Standard: Layered Architecture Across Languages
- Microservices: order-service