<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nikhil Wankhede on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Wankhede on Medium]]></description>
        <link>https://medium.com/@nikhilwankhede18?source=rss-16fb55e58ed1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Nikhil Wankhede on Medium</title>
            <link>https://medium.com/@nikhilwankhede18?source=rss-16fb55e58ed1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:38:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhilwankhede18/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Durable State vs. Durable Execution: Where CMMN, BPMN, and Temporal Actually Belong]]></title>
            <link>https://medium.com/@nikhilwankhede18/durable-state-vs-durable-execution-where-cmmn-bpmn-and-temporal-actually-belong-d752d3786033?source=rss-16fb55e58ed1------2</link>
            <guid isPermaLink="false">https://medium.com/p/d752d3786033</guid>
            <dc:creator><![CDATA[Nikhil Wankhede]]></dc:creator>
            <pubDate>Sun, 09 Aug 2026 07:20:18 GMT</pubDate>
            <atom:updated>2026-08-09T07:20:18.293Z</atom:updated>
            <content:encoded><![CDATA[<p>An underwriting case has been sitting untouched for three days. No thread is running. No workflow is sleeping. No worker is holding it open. There is a row in a database that says the medical review is active and nothing has happened since Tuesday.</p><p>Is that a broken system, or a correct one?</p><p>It depends entirely on which of two things you needed — and most architecture arguments about case management and workflow engines are really arguments about this, conducted without anyone naming it.</p><h3>The distinction that clears everything up</h3><p>Two ideas get collapsed into one because both involve a database and both survive a crash.</p><p><strong>Durable state remembers what is true.</strong></p><p><strong>Durable execution remembers how to reliably continue work.</strong></p><p>Durable state answers: <em>what is the current business state?</em></p><pre>UW Case #123</pre><pre>Census Review      = COMPLETED<br>Medical Review     = ACTIVE<br>Financial Review   = AVAILABLE<br>UW Decision        = AVAILABLE</pre><p>Put that in PostgreSQL. Kill the application. Restart it. Load the case. You know exactly where the business stands. That is durable state, and it is genuinely durable — nothing was lost.</p><p>Durable execution answers a different question: <em>how do I reliably continue an in-progress computation?</em></p><pre>Call Medical API<br>      ↓<br>Wait for response<br>      ↓<br>Retry after 24 hours<br>      ↓<br>Process response<br>      ↓<br>Escalate after 7 days</pre><p>Now crash the worker immediately after the API call. Restarting and loading the case state is not enough. Something has to know what already happened, what is still pending, whether a timer is armed, whether this is retry two or retry five, and what executes next.</p><p>The relationship is containment, not equivalence:</p><pre>DURABLE EXECUTION<br>        ┌─────────────────────────┐<br>        │                         │<br>        │     DURABLE STATE       │<br>        │                         │<br>        │   + timers              │<br>        │   + retries             │<br>        │   + events              │<br>        │   + recovery            │<br>        │   + continuation        │<br>        │                         │<br>        └─────────────────────────┘</pre><p>Durable execution implies durable state. Durable state does not imply durable execution. Anyone who tells you durable execution simply <em>is</em> durable state has flattened the useful part of the idea.</p><h3>Three engines, three questions</h3><p>With that in hand, the engines sort themselves out — not by what features they happen to ship, but by the question each one is built to answer.</p><p><strong>CMMN asks: what work is applicable right now?</strong></p><p>A case is a situation, not a sequence. Documents arrive. Medical review becomes applicable. A result comes back and unlocks financial review. An underwriter, exercising judgment, requests another document and the shape of the case changes again. The path was never predetermined. CMMN manages a changing business situation.</p><p><strong>BPMN asks: what happens next?</strong></p><p>Validate the census, calculate the premium, underwrite, branch on the decision, generate the quote, notify. Explicit flow, explicit gateways, explicit parallelism. When the process really is knowable in advance, drawing it as a process is honest modelling rather than premature structure.</p><p><strong>Temporal (or iWF) asks: how do I reliably keep executing?</strong></p><p>Activity, activity, sleep twenty-four hours, activity, wait for an external signal, activity — with retries, durable timers, signals, and recovery underneath.</p><pre>CMMN       → CASE<br>BPMN       → PROCESS<br>Temporal   → EXECUTION</pre><p>Here is the shorthand to resist, because it is almost right and therefore expensive:</p><blockquote><em>CMMN = durable state, BPMN = durable execution</em></blockquote><p>BPMN engines provide durable execution perfectly well. That is not the axis. The axis is the <strong>primary abstraction</strong> each tool reaches for — case, process, or execution. Two of these tools can offer overlapping capabilities while still modelling the world in incompatible ways, and it is the modelling difference that will shape your system.</p><h3>Why an idle case needs no running thread</h3><p>Back to the case that sat quiet for three days.</p><pre>Case #123</pre><pre>Status = WAITING_FOR_DOCUMENT<br>Medical Review = ACTIVE</pre><p>Nothing happens. Then something does:</p><pre>DocumentUploaded<br>       ↓<br>CMMN receives event<br>       ↓<br>Evaluate relevant sentries<br>       ↓<br>Update plan-item state<br>       ↓<br>Persist</pre><p>A case is a durable-state machine driven by events. It does not require 1 case = 1 thread. It consumes compute when something happens and costs nothing when nothing does.</p><p>Deadlines work the same way. “Escalate medical review after 48 hours” does not conceptually require a sleeping thread. It requires a durable row:</p><pre>case_id = 123<br>timer_id = T456<br>due_at   = ...<br>action   = ESCALATE</pre><p>A scheduler fires an event at the due time, and the case re-evaluates whether escalation is still applicable. Note that last clause — the case decides, not the timer. That distinction matters more than it looks, and we will come back to it.</p><p>Scale is why this framing earns its keep. A design where every case is an active execution behaves very differently at a million mostly-idle cases than a design where a case is a persisted fact.</p><h3>The real decision</h3><p>Nobody actually argues about definitions. They argue about a specific structural choice, which comes in two shapes.</p><h3>Option A — CMMN engine outside Temporal</h3><pre>CMMN<br>                  │<br>          Business Case State<br>                  │<br>          &quot;Execute this work&quot;<br>                  │<br>                  ▼<br>               Temporal<br>                  │<br>          Durable Execution<br>                  │<br>       ┌──────────┼──────────┐<br>       ▼          ▼          ▼<br>     APIs       Timers     Events</pre><p>CMMN owns the business case. Temporal owns durable execution. Clean seam.</p><h3>Option B — CMMN runtime inside Temporal</h3><p>The CMMN interpreter <em>is</em> a Temporal workflow. Case state, plan items, sentries, and lifecycle all live inside workflow state:</p><pre>CMMN Model<br>     ↓<br>CMMN Interpreter<br>     ↓<br>Temporal Workflow</pre><p>This is genuinely attractive, and the attraction is not naive.</p><p><strong>You stop building execution infrastructure.</strong> Durable timers, retries, waiting, signals, recovery, long-running execution — all of it arrives with the runtime instead of appearing on your roadmap as a case database, a timer scheduler, a job executor, a recovery mechanism, and an event processor.</p><p><strong>External orchestration gets trivial.</strong> A plan item becomes an activity, and retry and timeout semantics come free.</p><p>Now the costs, which are equally real.</p><p><strong>Coupling becomes structural.</strong> The architecture stops being CMMN → Temporal and becomes CMMN ≈ Temporal Workflow. Replacing Temporal later is no longer a swap at a boundary; it is a rewrite of your case engine.</p><p><strong>The abstractions grind against each other.</strong> CMMN is dynamic and case-centric — applicability, discretion, human judgment, ad-hoc additions. Temporal is execution-centric — deterministic replay, reliable continuation. Mapping one directly onto the other introduces friction at exactly the points where CMMN is most valuable: the moments a human changes the shape of the case.</p><p><strong>You still need a projection.</strong> Business users ask for all cases pending medical review, all cases assigned to a user, all cases missing documents, all cases breaching SLA. Your UI should not be querying workflow history for that. So you build a read model anyway:</p><pre>Temporal → Case Projection → PostgreSQL → Case UI</pre><p>Which means one of the arguments for going inside — fewer moving parts — partly refunds itself.</p><p><strong>History grows in ways that are hard to love.</strong> A dynamic case generates a lot of internal churn: event, sentry evaluation, plan-item transition, event, sentry evaluation, plan-item transition. If every internal transition lands in workflow history, you are paying execution-grade storage and replay costs for bookkeeping that was never an execution concern.</p><p><strong>Versioning couples.</strong> You will have CMMN definitions v1, v2, v3, and Temporal workflow code versioning, and long-lived cases that span several of both simultaneously. Two versioning problems that have to be reasoned about together are considerably worse than two versioning problems.</p><h3>When inside Temporal is the right call</h3><p>None of this makes Option B wrong. It makes it conditional. It is a good architecture when:</p><ul><li>CMMN is being used primarily as an execution model, not as the business semantics of a case</li><li>Every case naturally maps to a long-running execution</li><li>Temporal is already a mandatory platform dependency</li><li>You would rather not build durable execution infrastructure</li><li>Tight coupling to Temporal is acceptable — say so out loud</li><li>Case volume and history growth are manageable</li></ul><p>Under those conditions, a CMMN interpreter on Temporal is a powerful thing: CMMN supplies the business semantics, Temporal supplies the execution substrate.</p><p>The failure mode is arriving at Option B without meeting those conditions — choosing it because Temporal was already there, and discovering two years later that the semantic owner of your business cases is a workflow engine you cannot replace.</p><h3>The principle</h3><p>For a platform where case management is a first-class business capability rather than an implementation detail, the boundary I would defend is this:</p><pre>BUSINESS CASE<br>                       │<br>                       ▼<br>                     CMMN<br>                       │<br>             ┌─────────┴─────────┐<br>             │                   │<br>        Case State          Work Request<br>             │                   │<br>             │                   ▼<br>             │               Temporal<br>             │                   │<br>             │          Durable Execution<br>             │<br>             ▼<br>        Case Projection<br>             │<br>             ▼<br>             UI</pre><p>CMMN owns the business case. Temporal owns durable execution. Note that this is not an argument for using Temporal sparingly — CMMN can lean on it constantly, for every piece of orchestration, timing, and retry. The constraint is narrower and only about ownership: Temporal should not become the semantic owner of the case.</p><blockquote><em>Durable state makes the business situation recoverable. Durable execution makes in-progress work recoverable.</em></blockquote><blockquote><em>Keep business truth in the case model. Keep execution reliability in the workflow engine.</em></blockquote><h3>Fifteen questions for your own review</h3><p>Take these to the whiteboard. The answers, more than any general principle, will tell you which option you are actually in.</p><ol><li>Should a case exist independently of a workflow execution?</li><li>Is every case expected to have a long-running execution?</li><li>Who owns the business source of truth?</li><li>Where should case state be queried?</li><li>How will millions of mostly-idle cases behave?</li><li>How will CMMN definition versioning work?</li><li>How will workflow code versioning work?</li><li>How much CMMN internal state should become workflow history?</li><li>Can the workflow engine be replaced later?</li><li>Are timers business-state concerns or execution concerns?</li><li>Who decides whether a fired timer or event is still applicable?</li><li>How are human tasks represented?</li><li>How are ad-hoc plan-item additions represented?</li><li>What happens when a case is modified independently of an execution?</li><li>Can a case pause indefinitely without an active execution?</li></ol><p>If question 1 makes you hesitate, you are not choosing a technology. You are deciding what a case <em>is</em> in your system — and that decision will outlive whichever engine you pick to run it.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d752d3786033" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>