ADR-0019 — Workflow substrate: self-hosted Temporal cluster (§ 21 exception)
Governance note: Runtime references corroborate Temporal in production, while this ADR’s formal status remains
proposed. The supersession link records the evidenced substrate replacement without silently changing formal acceptance status.
Context
ION’s V3 pipeline runs automation as its dominant control flow. Per
context/capacity-model.md, the auto-close
ratio target is ~96 % — meaning almost every incident that enters the
platform is carried end-to-end by workflow code, not by human hands. The
concrete workflow surface area includes:
- Triage runbooks — per-detection-usecase decision trees that run on every incident and decide TP / FP / BP / UNKNOWN and auto-close vs. escalate.
- Investigation runbooks — enrichment, entity expansion, graph build, ION IQ (AI) hand-offs.
- Response actions — MFA challenge, password reset, device isolation, ticket creation in ServiceNow, comment write-back to Sentinel.
- Cross-system sagas — long-lived flows that span Watchtower → Cogs → Pigeon → Alya, coordinated within a system while the systems themselves communicate through the event backbone (see ADR-0003).
A major V2 workflow substrate was Azure Logic Apps (Tiberium origin), combined with Automation Rules in Sentinel and Azure Functions. V2 was a mixed Logic Apps/Functions model rather than a universal Logic Apps-only substrate. The Tiberium retrospective (Architecture- Tiberium Architecture Review.md) already documented why that substrate did not survive contact with ION-scale requirements:
- Development in the Azure Portal designer, not the git repo → no diff, no code review, no unit tests, no environment parity.
- Monitoring, custom logging, feature flags, blue-green, retry policy — all require bolt-ons that partially defeat the “low-code” premise.
- Per-execution billing at Tiberium’s projected volumes (~4.4M Logic App runs/day at 300 customers × 30K users, per the Tiberium data points) turns into an unbounded cost line.
V3 needed a workflow substrate that is: code-first, replayable, durable across process restarts, versionable, testable, observable, and horizontally scalable to sustained ~5 workflows/sec (peak ~25/sec) with individual workflows running for hours to days.
Forces / Drivers
- Requirement / Constraint: Automation carries the ~96 % auto-close target (capacity-model.md § Auto-close); ~5 workflows/sec sustained, ~25/sec peak, ~5 workflows/incident, ~10 activities/workflow (per capacity model D-9/D-10); workflows may span hours to days (waiting for MFA challenge response, customer approval on adaptive card, ServiceNow ticket resolution).
- Principle(s) embodied: § 11 Automation First; § 6 Choreography over orchestration (Temporal is the inside-a-system orchestration engine, never a cross-system conductor); § 14 Independent scalability; § 21 Azure-native managed services first (this ADR is the sanctioned exception).
- WAF pillar optimized:
operational-excellence(primary — code-first workflows, replay, versioning, test harnesses);reliability(durability across failures, exactly-once activity semantics with idempotent activity design);performance-efficiency(horizontal scale of workers).
Decision
ION V3 adopts self-hosted Temporal as the workflow substrate for the Cogs system. Cogs owns the Temporal cluster end-to-end and exposes workflow execution as a capability that other ION systems consume via the event backbone and Cogs’s Trilateral APIs (per ADR-0001).
Cluster shape (current V3, per Container View- Cogs.md, October 2025):
Corrected by the 2026-10-15 amendment: the deployed cluster runs on Azure Container Apps with MySQL Flexible Server for both persistence and visibility. See Amendments.
- Temporal server components (frontend, matching, history, worker) deployed on Azure Kubernetes Service (AKS) in the ION Platform spoke.
- Persistence store: Azure Database for PostgreSQL Flexible Server — workflow history, mutable state, event log.
- Visibility store: Azure Database for MySQL Flexible Server — search attributes and workflow indexing.
- Workers: ION-owned worker fleets (C# / Python) deployed alongside each domain service that hosts activities.
- Cluster is single-region (Swiss North), zone-redundant via AKS availability zones and zone-redundant Flexible Server SKUs. DR posture inherits ADR-0017.
Coexistence during migration. Legacy Logic App workflows and Temporal workflows both run through the Cogs execution plane during the migration window (per Container View- Cogs.md Oct 2025 note). Logic Apps are being retired usecase-by-usecase; net-new triage/investigation/response runbooks are Temporal-only.
Alternatives Considered
Option A — Azure Durable Functions
Rejected — decisive: replay/versioning/execution-model gaps at ION’s workflow shape.
Durable Functions is Microsoft’s Azure-native answer to code-first orchestration and would satisfy § 21 without an exception. It was seriously evaluated and rejected on capability grounds:
- Deterministic replay constraints. Orchestrator code must be
deterministic and side-effect-free; violating this silently corrupts
workflow state. Temporal has the same constraint but pairs it with a
vastly richer test/replay tooling (
WorkflowReplayer, deterministic time control, protected activity boundary) that Durable Functions workflows do not match at ION scale. - Versioning story. Durable Functions’ side-by-side versioning
requires either code-embedded
IsReplaying/version-check branches or full task-hub swaps. Temporal’sGetVersionand worker-versioning primitives (build IDs) are a first-class part of the platform. ION runbooks change weekly; workflows in flight must not break. - Execution-time and history-size limits. Durable Functions history is stored in Azure Storage; long-running orchestrations (hours to days waiting on adaptive-card responses) accumulate history that hits practical limits and cost cliffs. Temporal’s history compaction and continue-as-new ergonomics are purpose-built for this shape.
- Multi-language worker fleets. ION runs C# for platform services and Python for AI-adjacent workflows (ION IQ hand-offs). Durable Functions’ cross-language story is thinner than Temporal’s polyglot SDK matrix.
Option B — Azure Logic Apps (Standard) — retain V2 substrate
Rejected — decisive: LCNC development/testing/debugging model does not scale. Reinforcing: per-execution cost at ION volume.
Documented at length in the Tiberium retrospective. Portal-designer authoring blocks code-review workflow, unit testing, and repository parity. Per-run billing at ~5 workflows/sec sustained is an unbounded cost line scaling linearly with customer count. Retained temporarily during migration; not the target substrate.
Option C — Azure Container Apps Jobs / Kubernetes CronJobs
Rejected — decisive: no durable-state / no signal semantics.
Job-scheduling primitives cannot represent hours-long workflows waiting on external signals (MFA response, adaptive-card approval, SNOW ticket closure). Building durability + signal semantics on top would rebuild Temporal poorly.
Option D — Camunda / Zeebe (BPMN engines)
Rejected — decisive: BPMN-centric authoring, weaker code-first ergonomics. Reinforcing: § 21 — still self-hosted, so it must clear the same “capability gap large enough to justify self-hosting” bar as Temporal — and it does not.
BPMN’s visual/XML-first model is optimized for business-process modelling, not code-first workflows written by platform engineers. ION runbook logic lives comfortably in typed code; forcing BPMN adds ceremony without buying anything ION needs.
Option E — Netflix Conductor / Argo Workflows
Rejected — decisive: weaker programming model for ION’s language mix (C# / Python). Reinforcing: § 21 — self-hosted with no offsetting advantage over Temporal.
Conductor’s JSON DSL for workflows is a step backwards from typed code. Argo is optimized for Kubernetes-native data pipelines (DAGs), not for long-lived signal-driven workflows.
Option F — Temporal Cloud (SaaS, Temporal-managed)
Rejected — decisive: data-residency and network-egress requirements. Reinforcing: cost at ION scale, not available as Azure PaaS (third-party SaaS on AWS-backed hosting).
Temporal Cloud would remove ION’s operational burden (which is exactly
what § 21 wants), but at V3 it did not offer a Switzerland region for
Swiss customer workloads (per context/constraints.md
data-residency constraint). Workflow payloads carry incident data
including entity details that must remain in Swiss/EU tenancy for regulated
customers. Cost at sustained ~5 workflows/sec × 10 activities/workflow
also compared unfavorably to a self-hosted cluster.
Neutral note: If Temporal Cloud adds an Azure-hosted Swiss region with acceptable pricing, ION should revisit this decision — moving to Temporal Cloud would satisfy § 21 and eliminate the exception this ADR records.
Option G — AWS Step Functions / Google Cloud Workflows
Rejected — decisive: not on Azure.
ION is Azure-resident (see ADR-0016 hub-spoke topology). Cross-cloud dependency is a non-starter.
Rationale
Temporal wins because it is the only substrate evaluated that provides code-first, replayable, versionable, signal-capable, horizontally scalable workflow execution at ION’s shape — and none of the Azure-native options close the gap. The rejection of Durable Functions is the load-bearing argument for the § 21 exception: without a credible Azure-managed alternative, the “capability gap large enough to justify self-hosting” bar in § 21 is met.
The exception is bounded and named. The operational burden is owned by a single system (Cogs) with a clear team, not spread across the platform. The persistence and visibility stores remain Azure-managed PaaS (PostgreSQL Flexible, MySQL Flexible) — the § 21 exception is scoped to the Temporal server tier, not to every dependency of that tier.
Temporal’s role is strictly intra-system orchestration inside Cogs. Cross-system collaboration continues to flow over the event backbone per ADR-0003; Temporal never becomes the platform-wide conductor. This preserves the choreography posture between systems while giving each workflow inside Cogs a durable, observable execution model.
Consequences
Positive
- Code-first workflows: authored in-repo, PR-reviewed, unit-tested with
WorkflowReplayer, deployed via ADR-0015-era same-pipeline discipline (§ 15). - Long-lived workflows with signals unlock the auto-close pipeline (adaptive-card approvals, ServiceNow round-trips, MFA challenges) as single coherent workflows instead of glued-together Logic App fragments.
- Versioning + build-ID worker routing lets ION change runbooks weekly without breaking in-flight workflows.
- Horizontal worker scaling per activity type is aligned with § 14 (independent scalability).
- Removes a large chunk of the Tiberium-era Logic-App cost line.
Negative
- § 21 exception paid in operational burden. ION’s SRE + Cogs team now owns: cluster upgrades, schema migrations on Postgres/MySQL, worker fleet capacity planning, temporal-cli tooling, replay-safety review of every workflow PR, and DR drills for the cluster.
- Postgres/MySQL Flexible Server are two additional stateful stores with their own PITR, patching, and SKU-limit windows.
- Determinism discipline is now a codebase-wide standard developers must learn; violating it is a silent corruption class of bug.
- Legacy Logic Apps continue to run during migration → dual-substrate cognitive load for on-call and for anyone reading pipeline diagrams.
Neutral / follow-ups
- Track a § 21 exit criterion: revisit Temporal Cloud (Swiss/EU region + acceptable pricing) or a future Azure-managed workflow service (post-Durable-Functions successor). Exit would collapse this exception.
- Logic Apps retirement burn-down list owned by Cogs + affected system teams; target: net-new runbooks Temporal-only from V3 forward.
- Multi-region Temporal (active-passive) inherits ADR-0017; the Temporal server + Postgres/MySQL replicas are part of the warm-spare scope. Deferred until warm-spare posture ships.
- Publish workflow-authoring standards (determinism rules, activity
idempotency, versioning discipline) as a
standards/temporal-workflow-standards.mdfollow-up.
WAF Pillar Impact
- Primary pillar:
operational-excellence— the whole point is code-first, testable, versionable, observable workflow execution to replace LCNC. - Secondary pillars:
reliability(durable state, replay, signal-driven long-lived workflows survive process restarts);performance-efficiency(horizontal worker scaling, matched to incident throughput). Cost-optimization: removes Logic App per-execution billing, adds cluster + stateful-store fixed cost — net positive at V3 volume, net cost at very low volume. - Trade-offs: § 21 is violated by design to buy the capability gap; the exception is paid in permanent operational surface area (cluster patching, DB migrations, replay-safety review, DR drills). ION accepts this because the alternative (LCNC or Durable Functions) does not meet the workflow requirements at V3 scale.
Previous approach (V2)
V2 used Azure Logic Apps + Automation Rules + Azure Functions — the Tiberium substrate. See Architecture- Tiberium Architecture Review.md for the detailed retrospective and the concrete per-day execution counts (Enrichment 972K/day, IncidentTriage 972K/day, AdaptiveCard 2.43M/day at 300 customers × 30K users). The V2 substrate failed on:
- Development velocity (portal-designer authoring, no repo parity, no unit tests).
- Testability and mockability of external integrations (Sentinel, MDE, Teams).
- Debuggability and observability (custom-logging bolt-ons).
- Feature-flag / blue-green / zero-downtime deployment.
- Failure-handling patterns (retry, queuing, DLQ) — implementable but awkward.
- Per-execution cost at ION-scale.
V3 replaces the Logic App control plane with Temporal workflows; Automation Rules in Sentinel remain only as the ingestion trigger (per ADR-0028, which normalizes V2 ADR4’s Model 2 — playbook stored on the partner side), and Azure Functions are retained only where a short stateless activity makes sense.
Amendments
-
2026-10-15 — Cluster shape corrected to the deployed state. The cluster shape in the Decision (AKS with PostgreSQL persistence and MySQL visibility) describes the October 2025 container view. It does not match what is deployed. The deployed cluster (ziege) is:
- Temporal server components (frontend, history, matching, worker) and
the Temporal UI and admin tools run on Azure Container Apps, in the
zone-redundant
coapp-zgeenvironment. Zone redundancy is enabled ingmaandprd. - Azure Database for MySQL Flexible Server 8.4 holds both the
persistence and the visibility stores. In
gmaandprdit runs with zone-redundant HA, 30-day backup retention, and geo-backup. - Elasticsearch advanced visibility is optional and not deployed.
- PostgreSQL is not part of the Temporal cluster. The ziege PostgreSQL server is a vector store for AI features.
The decision to self-host Temporal is unchanged. The DR posture still inherits ADR-0017. See the MySQL DR page.
- Temporal server components (frontend, history, matching, worker) and
the Temporal UI and admin tools run on Azure Container Apps, in the
zone-redundant
References
references/Container View- Cogs.md— October 2025 status: Temporal live in PROD, dual-substrate migration.references/Architecture V2- Automation.md— V2 automation pipeline and runbook framework.- ADR-0028 and
references/Architecture V2- ADR4 - Automation-SOAR.md— normalized and raw V2 Automation/SOAR records (Model 2 retained; execution substrate replaced). references/Architecture- Tiberium Architecture Review.md— the Tiberium retrospective; primary evidence for V2 substrate rejection.context/capacity-model.md— workflows/incident, activities/workflow, sustained + peak workflow rates.- Temporal documentation: https://docs.temporal.io/
- Azure Durable Functions: https://learn.microsoft.com/en-us/azure/azure-functions/durable/ (evaluated and rejected — see Option A).
Related ADRs
- Depends on: ADR-0001 (Trilateral APIs — Cogs exposes workflow triggers over the event backbone); ADR-0003 (Temporal is the inside-a-system orchestrator, not a cross-system conductor); ADR-0016 (Temporal cluster lives in ION platform spoke); ADR-0017 (Temporal DR inherits platform posture).
- Depended on by: pending Cogs system-level ADRs (worker fleet topology, activity idempotency contract).
- Related: ADR-0008 (Cogs subscribes to event backbone to trigger workflows).