Durable execution

지속 실행

Persist long-running progress so execution can resume after interruption.

···
html
<div class="scene"><div class="title">WORKER CRASH / RESUME</div><div class="steps"><span id="s1">01 CHARGE</span><span id="s2">02 WAIT</span><span id="s3">03 SHIP</span></div><div class="checkpoint"><div id="progress"></div></div><div id="workerState" class="tile">Worker running</div></div>
css
.scene{width:min(94vw,760px);height:min(86vh,320px);padding:clamp(10px,2.5vmin,18px);border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--fg);font:500 clamp(11px,1.3vw,16px)/1.25 "Pretendard Variable",Pretendard,-apple-system,sans-serif;display:flex;flex-direction:column;gap:clamp(7px,1.6vmin,12px);overflow:hidden}.scene *{box-sizing:border-box}.title{font-weight:750;color:var(--accent)}.muted{color:var(--muted)}.mono{font-family:ui-monospace,monospace}.row{display:flex;align-items:center;justify-content:center;gap:clamp(5px,1.4vmin,12px);flex:1;min-height:0}.tile{border:1px solid var(--line);border-radius:8px;background:var(--bg);padding:clamp(6px,1.6vmin,12px);text-align:center;min-width:0}.on{border-color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 12%,var(--surface))!important}.pulse{animation:pulse 1.6s infinite alternate}@keyframes pulse{to{border-color:var(--accent);transform:translateY(-3px)}}.steps{display:flex;gap:4px}.steps span{flex:1;text-align:center;border:1px solid var(--line);border-radius:5px;padding:8px 1px}.steps .on{background:color-mix(in srgb,var(--accent) 15%,var(--surface));border-color:var(--accent)}.checkpoint{height:24px;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--bg)}.checkpoint div{height:100%;width:0;background:var(--accent);transition:width .5s}.scene #workerState{align-self:center;min-width:55%}
js
let phase=0;function tick(){const p=phase%5;document.querySelectorAll('.steps span').forEach((el,i)=>el.classList.toggle('on',i<(p===3?2:Math.min(p+1,3))));document.getElementById('progress').style.width=[33,66,66,66,100][p]+'%';document.getElementById('workerState').textContent=['Step 1 saved','Step 2 saved','Worker crashed','New worker: resume at step 3','Workflow complete'][p];phase++}tick();setInterval(tick,900)

Durable execution records workflow steps and results in persistent history. After a worker stops, another worker can replay that history and continue without repeating completed steps.

The demo interrupts a worker after step two and resumes from a checkpoint. External side effects can be retried, so activities need idempotent design.

When to use

Use it for tasks such as approval waits or order flows that outlive a server process.

Open as page ↗