ADR-00032 — Temporal vs. Camunda for Checkout Saga Workflow Orchestration

By Engineering Team•October 8, 2026•6 min read
  • 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/worker shape 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-service is already Go, per ADR-00011 — Temporal’s official Go SDK (pkg/temporal/ in go-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}} and workflow.NewTimer/workflow.GetSignalChannel are standard SDK primitives already used by every activity in checkout_saga_workflow.go — see ADR-00034 for the full detail on what this buys over hand-written coordination.
  • 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.yml runs a temporal service (frontend, gRPC, port 7233) and temporal-ui alongside 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/refundPayment already 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-service with 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 way pkg/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/refundPayment as BPMN compensating activities doesn’t remove the need to implement the actual compensating logic as a call into inventory-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.