Contents
Articles inference temporal_llm_durability

Checkpointing LLM chains with Temporal

When call three fails, you pay for six

Multi-step LLM inference chains are structurally fragile. Temporal workflow durability turns retry-from-scratch into replay-from-checkpoint.

Project Continuum Engine Authors @Tristan & @Claude Topic Inference
Created 2026-03-24 Updated 2026-09-29 Version 1.5

The Problem

The pipeline everyone pretends is simple.

The moment you move past a demo, inference becomes a chain of compute-dependent calls:

  1. Classify the user's intent.
  2. Generate a response based on that classification.
  3. Validate the output against your schema or safety rules.
  4. Post-process: parse, format, guardrail checks.

Four calls minimum - often more if you're doing RAG retrieval, summarization, or agent tool selection upstream. Each call depends on the one before it. The generation needs the classification. The validation needs the generation. Post-processing needs all of it.

Most teams build this with try/catch blocks and exponential backoff. It works on the most trivial of issues. On anything else, a failure restarts the entire chain from scratch.

The Cost

When call three fails, you've already paid for calls one and two.

A four-call chain where the validation step times out loses the validation and the classification and generation that preceded it. Those tokens and that latency are already spent, and the user is still waiting.

The duct-tape solutions are well-known. Retry with exponential backoff handles transient failures but re-executes every completed step. Circuit breakers prevent cascade failures but don't preserve intermediate results. Manual caching (Redis, DynamoDB) can checkpoint results, but now you're writing and maintaining state management code for every pipeline stage - TTLs, invalidation, coherency, the full distributed state nightmare.

These are band-aids on structural problems, ones that have been solved for years by other software engineering domains.[1] The pipeline has no durable checkpoints. Every failure is a full restart because nothing remembers what already succeeded.

The Solution

Temporal turns the chain into a workflow.

Temporal is a durable execution platform.[1] Each LLM call becomes a Temporal activity - or its own child workflow. When an activity completes, Temporal durably records the result as a checkpoint, without you writing any persistence code. If the workflow crashes, restarts, or times out on step three, it replays from the last checkpoint. Steps one and two don't re-execute. Their results are already recorded.

The workflow definition is the retry logic. No dead letter queues, no manual state reconciliation, no Redis cache to keep coherent. You write the pipeline as a sequence of activity calls. Temporal handles the rest - timeouts, retries, replay, and recovery.[2]

Longer chains gain more: agent loops that iterate 10+ times; RAG pipelines with retrieval, ranking, generation, and validation; multi-model routing where different models handle different parts of the response. Each additional step is another checkpoint that Temporal preserves. OpenAI's Codex agent and Replit's Agent both run on Temporal.[3]

The Math

One failed Validate call costs six LLM calls instead of four.

Three of the four pipeline steps are LLM calls: Classify, Generate, Validate. Post-processing is deterministic. When step three (Validate) fails, three LLM calls have run, including the one that failed. The retry re-runs all three from scratch. That's six total LLM calls to get one successful result, double the cost. With Temporal, the retry runs only the failed Validate call again, for four total LLM calls.

Scale that to an agent loop doing 10 LLM calls where call 8 fails. Without durability, the retry runs all 10 again, for 18 calls in total. With Temporal it runs call 8 again and carries on, for 11.

Durability itself is cheap. Measured against the same model call made directly, 200 runs per arm on two runtimes, wrapping it in a Temporal workflow costs 24 to 28 ms at p95 outside the call, and 25 to 32 ms at p99. Continuum's whole platform around the call, with Redis Streams for I/O, PostgreSQL for state and a notice back to the client, is a separate, real-world number: 35 to 43 ms at p95 outside the model's activity, on LM Studio. Both are broken down, stretch by stretch, in the durable inference benchmark.

Your Numbers

What does this cost you?

You think those LLM calls are just a few pennies you're spending? What about next year?

Assumptions [ − ] [ + ]

This calculator is a visual aid, not a billing estimate.

Not all errors cost an inference charge. Most providers don't bill for 5xx or timeout responses. But some managed services do charge for calls that return tokens your validation rejects - the call "succeeded" as far as the API is concerned.

The retry math also assumes a single retry attempt. In practice, even with in-place retry, there are only so many attempts you can make before the Client → API timeout fires. This doesn't account for retries that keep running after the client has already disconnected - a common misconfiguration where the server burns tokens for a response nobody will ever read.

Temporal doesn't have these problems. There's no cascading retry pressure from client timeouts. The workflow runs to completion regardless of client connection state, and the client gets the result when it's ready - by push notification or signal + query.

500K 100M
1 5
$0.003 $0.06

Tiered action pricing applies

Without Temporal

Total requests 1,000,000

~2,740 / day

Failed requests 10,000

2.97% compounded across 3 calls

LLM calls 3,000,000

$75,000 at $0.025/call

Retried LLM steps 30,000

$750 - full chain re-run on failure

Wasted LLM calls 20,000

$500 - already succeeded, re-run anyway

Total LLM calls 3,030,000
Total cost $45,450

With Temporal

Total requests 1,000,000

~2,740 / day

Failed LLM calls 10,000

each replayed individually

LLM calls (all requests) 3,000,000

$45,000 at $0.015/call

Retried LLM steps 10,000

$150 - only the failed step re-runs

Total LLM calls 3,010,000
Total LLM cost $45,150
Temporal cost[8] $51

0.11% of total spend

Total cost $45,201

Net annual savings

$15

After Temporal costs

Wasted LLM calls eliminated

1,000

This is before any SLA or contractual cost. A full retry also repeats the latency of every call before the failure, where a Temporal retry repeats only the failed call's.

How Temporal cost is calculated[8] [ − ] [ + ]
Activities per workflow 3 LLM + 1 post = 4
Actions per workflow 5 base + (4 × 2) = 13
Total actions / year 13,000,000
Monthly (÷ 12) 1,083,333
Tiered monthly pricing:
First 1Mincluded (Essentials)
Next 5M$50 / million
Next 5M$45 / million
Next 10M$40 / million
Next 30M$35 / million
Next 50M+$30 / million
Annual Temporal cost $51.00
Energy cost of retries [ − ] [ + ]
Energy per LLM call[5] ~0.5 Wh
Energy wasted on retries (no Temporal) 0.75 kWh
Equivalent to charging 0.06 EVs

Every wasted LLM call burns real electricity on work that produced nothing.

← Back to Articles