ArchitectureIntermediate

Durable Execution: Temporal vs Step Functions vs Inngest

DeveloperHat Team
16 min read

TL;DR

A crashed workflow should resume, not restart. Temporal, Step Functions, and Inngest compared on programming model, hosting, cost, and when each one fits.

Every backend eventually grows a process that spans several steps and several services: charge the card, wait three days, create the shipment, email the customer. Written as plain code, that process breaks the first time a deploy lands mid-run or a container restarts — the card is charged, the shipment is never created, and nobody knows where it stopped. Durable execution is the fix: the runtime records every step as it completes, and if anything crashes, the workflow resumes from the last recorded step instead of starting over. Temporal, AWS Step Functions, and Inngest all sell that guarantee, but they sell it in very different shapes — code you host, JSON AWS runs, or functions that live in your app.

The short version: if your workflows run for hours or days, span teams, and must survive deploys, Temporal is the strongest foundation — at the cost of running workers and a server. If you are already all-in on AWS and your workflows fit a state machine, Step Functions is the fastest to production and the cheapest at moderate volume. If your app is serverless or Next.js and your workflows are event-driven background jobs, Inngest gets you durable execution with no new infrastructure. The rest of this guide is the evidence behind that call.

Crash mid-run, resume — don't restart Completed steps are recorded in the journal, so the replay skips them. Trigger event · cron Step 1 done · saved Step 2 crash! Replay from journal Step 3 runs once Done no re-charge Durable journal every step result recorded The journal is the product: completed steps are never re-run, so a crash costs time, not correctness.

What durable execution actually guarantees

The core idea is the same in all three systems. You write a workflow — a function that orchestrates the process. Anything with a side effect (calling an API, writing to a database, sending an email) is a step. When a step completes, its result is recorded durably in a journal or history. If the process crashes, the workflow re-runs from the start, but every step that already completed returns its recorded result instead of running again. Execution fast-forwards to where it stopped and continues.

Two rules follow, and they matter more than any feature list. First, steps must be idempotent. A crash can happen after a step's side effect but before its result is recorded, so that step may run again — charging a card twice is a bug in your step, not in the engine. Second, workflow code must be deterministic in systems that replay it: the replay has to take the same path as the original run, so non-determinism (random numbers, the current time, an API call) belongs inside steps, never in the orchestration code.

With those rules, you get things that are hard to build by hand: durable timers ("wait three days, then send a reminder" survives restarts), retries with backoff per step, sagas with compensation when a later step fails, and full visibility into where every running instance is. What durable execution does not give you is a free pass on design: a workflow that waits on a human for a week still needs a human to answer, and a step that was never idempotent will still double-charge on replay.

Option 1: Temporal — the workflow is code

Temporal is the open-source platform that did most to popularise this model — it grew out of Uber's Cadence, is MIT-licensed, and its server reached v1.32.0 in September 2026. You write a workflow as a plain function in Go, Java, Python, TypeScript, .NET, PHP, Ruby, or Rust, and split the work into two pieces: workflows hold the orchestration logic and must be deterministic, because Temporal replays them to recover state; activities are the side effects — API calls, database writes, model calls — and Temporal retries them on its own, with timeouts, exponential backoff, and heartbeats configured, not hand-coded.

// workflows.ts — the workflow is just a function
import { proxyActivities, sleep } from '@temporalio/workflow';
import type * as activities from './activities';

const { chargeCard, createShipment } = proxyActivities<typeof activities>({
  startToCloseTimeout: '30 seconds',
  retry: { maximumAttempts: 5, initialInterval: '1 second' },
});

export async function processOrder(orderId: string) {
  await chargeCard(orderId);
  await sleep('3 days'); // a durable timer — survives restarts and deploys
  await createShipment(orderId);
}

The architecture is a separate service: a Temporal server backed by PostgreSQL, MySQL, or Cassandra, plus workers — your processes — that poll task queues for workflow and activity tasks. Workers are stateless; if one dies, another picks up the history and replays it. You can self-host the server, or pay for Temporal Cloud, which starts at $50 per million actions with $150 in credits for 90 days and no base monthly fee, per Temporal's pricing page. Actions are the billable operations between your app and the Cloud — workflow starts, activities, timers, signals, queries — so estimate from a sample workflow before budgeting; Temporal's own pricing FAQ recommends exactly that. Storage is metered separately, starting at $0.042 per GB-hour for active storage.

Where Temporal wins: it is the strongest choice for long-running workflows — days to months — with the most mature ecosystem, the most explicit control over retries and timeouts, and the most room to grow: child workflows for fault isolation, signals and queries to interact with a running workflow, schedules with backfill, and worker versioning for safe deploys. It is also the natural pick for durable AI agents: the official OpenAI Agents SDK and Google ADK integrations run LLM and tool calls as durable activities, so an agent that crashes mid-task resumes instead of restarting. See our autonomous AI agents guide for what those agents look like before you make them durable.

Where it loses: you run infrastructure. Even on Temporal Cloud you operate workers, task queues, and deployments; self-hosted, you also operate the server and its database. The determinism rule is a real constraint — workflow code cannot call Date.now() or Math.random() directly, and newcomers hit that wall in their first week. And the event history is a cost as well as a feature: very long histories need Continue-As-New to stay manageable.

Option 2: AWS Step Functions — the workflow is a state machine

Step Functions, launched by AWS in 2016, describes the workflow as JSON in the Amazon States Language instead of code. You declare states — Task, Choice, Wait, Parallel, Map — and AWS runs the engine, routes each state to a service, and keeps the execution history. There is nothing to host, nothing to poll, and nothing to upgrade.

{
  "Comment": "Order workflow: charge, wait, ship",
  "StartAt": "ChargeCard",
  "States": {
    "ChargeCard": {
      "Type": "Task",
      "Resource": "arn:aws:states:::lambda:invoke",
      "Next": "WaitForFulfilment"
    },
    "WaitForFulfilment": { "Type": "Wait", "Seconds": 259200, "Next": "CreateShipment" },
    "CreateShipment": { "Type": "Task", "Resource": "arn:aws:states:::lambda:invoke", "End": true }
  }
}

There are two workflow types, and picking the wrong one is the most common mistake. Standard workflows run for up to one year, give exactly-once execution, and keep a queryable execution history for 90 days. They bill $0.000025 per state transition in us-east-1 — $25 per million — with 4,000 free transitions a month that never expire, and waiting costs nothing: a workflow parked in a Wait state for a week accrues no charges. Express workflows run for at most five minutes and bill per request ($1.00 per million) plus duration, making them far cheaper for high-volume, short work — but asynchronous Express executions are at-least-once, and history only exists if you configure CloudWatch Logs. Both types cap every state, task, and execution payload at 256 KiB, and a Standard execution caps at 25,000 history events — a loop that runs for thousands of iterations needs child workflows. See the Step Functions pricing page and the Standard vs Express comparison in the AWS docs for the full quotas.

Where Step Functions wins: it is the fastest path to a durable workflow if you are already on AWS. Direct integrations with 200+ AWS services mean most steps are a single state with no Lambda in between, the visual console makes debugging an execution genuinely pleasant, and Standard's "waiting is free" pricing makes human approvals and multi-day waits nearly free. Our Step Functions patterns guide covers the state shapes that come up most.

Where it loses: the workflow lives in JSON, which is a poor language for branching logic — a state machine with twenty states is harder to review than the equivalent function, and refactoring one is a manual exercise. You are also inside AWS: the engine, the history, and the integrations do not leave the cloud, and the 256 KiB payload limit forces you to pass references (an S3 key, a database row id) instead of data. Express's at-least-once semantics surprise teams that assume every workflow type is exactly-once.

Option 3: Inngest — durable functions in your own app

Inngest is the youngest of the three, and the shape is different again: your workflow code lives in the app you already deploy, and Inngest calls it over HTTP — usually at an /api/inngest endpoint — one step at a time, checkpointing each step's result. There are no workers to run and nothing new to host; it works on Vercel, Cloudflare, and any serverless platform, with a Connect mode that talks to persistent workers over an outbound WebSocket when HTTP timeouts get in the way.

// app/api/inngest/route.ts — the function lives in your app
export const processOrder = inngest.createFunction(
  { id: 'process-order' },
  { event: 'order/placed' },
  async ({ event, step }) => {
    await step.run('charge-card', () => chargeCard(event.data.orderId));
    await step.sleep('wait-for-fulfilment', '3 days');
    await step.run('create-shipment', () => createShipment(event.data.orderId));
  },
);

The model is event-driven: functions trigger from events, crons, or other functions, and step.run() is the checkpoint boundary — wrap existing code in it and each step gets automatic retries, state, and failure recovery. waitForEvent pauses a run until a matching event arrives or a timeout passes, which is the human-approval pattern without a polling loop. Pricing is per execution — one per run plus one per step, so a five-step function costs six executions — with a free tier of 50,000 executions a month (5 concurrent steps, 24-hour trace history, runs pause at the quota instead of charging overage), Pro from $99 a month for 1 million executions and 100 concurrent steps, and Business from $499 for 10 million. Maximum run length is 30 days on Free, 90 days on Pro, and 366 days on Business, per Inngest's pricing page. SDKs cover TypeScript, Python, Go, and Kotlin/Java; the server is open source under the Server Side Public License with delayed Apache 2.0 publication, while the SDKs are Apache 2.0.

Where Inngest wins: it is the shortest path from a serverless app to durable workflows — add an endpoint, wrap your functions in steps, deploy the app you already deploy. The event-driven model fits background jobs, webhooks, and AI agent loops naturally, and the free tier is generous enough to run a real side project. Our event-driven microservices guide covers the event patterns Inngest functions plug into.

Where it loses: every step is an HTTP round-trip to your app, so a workflow with hundreds of steps pays that overhead hundreds of times, and each step is still bound by your host's timeout — a step that runs for ten minutes needs a host that allows it. The free tier's 5 concurrent steps cap parallel fan-out hard, and the polished dashboard and observability stack are cloud-only: the self-hostable core is the engine, not the product. Teams with strict data-residency requirements should read that split carefully before committing.

Same guarantee, three shapes The journal is the same idea everywhere — only the home for your logic moves. TEMPORAL · CODE Workflow function code · loops · ifs Workers poll queues server + Postgres you run the workers STEP FUNCTIONS · JSON State machine JSON states · tasks · waits AWS runs the engine Lambda · 200+ services AWS runs everything INNGEST · YOUR APP step.run() in app events · crons · waits HTTP callbacks /api/inngest · Connect your app runs the code Temporal moves the logic into your code; Step Functions moves it into JSON; Inngest leaves it in your app.

Head-to-head

DimensionTemporalStep FunctionsInngest
Programming modelWorkflow as code (function)State machine as JSON (ASL)Durable functions in your app
HostingYou run workers; server self-hosted or CloudFully managed by AWSNo workers; Inngest calls your app over HTTP
Max run lengthMonths (durable timers, Continue-As-New)1 year Standard; 5 min Express30 days Free; 90 days Pro; 366 days Business
Execution semanticsExactly-once workflow executionExactly-once Standard; at-least-once Express asyncAt-least-once steps with idempotent replays
Pricing meterPer action ($50/million on Cloud, from)Per state transition ($0.000025) or per request + durationPer execution: 1 per run + 1 per step
Free tier$150 Cloud credits for 90 days4,000 transitions/month, never expires50,000 executions/month
Versioning / deploysWorker versioning, replay testsState machine versionsDeploy your app; steps are code
Best forLong-running, multi-team workflows; durable agentsAWS-native orchestration; human approvalsServerless / Next.js event-driven jobs
Watch out forYou operate workers; determinism rulesJSON gets unwieldy; 256 KiB payloadsStep timeouts follow your host; 5-step free concurrency

Trade-offs

The trade-off nobody puts in the demo is the cost meter, and what it counts. Step Functions Standard charges per state transition and nothing for waiting — a workflow that sleeps for a week costs the same as one that finishes in a minute. Inngest charges per execution, so a five-step function costs six executions and the bill grows with step count, not with time. Temporal Cloud charges per action, and a single workflow generates several actions per step, so the only honest estimate comes from running a sample workflow — which is exactly what Temporal's pricing FAQ recommends. Worked example, at November 2026 list prices for 100,000 runs a month with five steps each: Step Functions Standard is roughly 500,000 transitions × $0.000025, about $12.50 a month plus Lambda compute; Inngest is 600,000 executions, inside Pro's 1 million at $99 a month plus your own compute. The numbers flip with volume and step count, so price the shape you actually run.

The second trade-off is versioning: what happens to workflows already running when you deploy. Temporal has the most deliberate answer — worker versioning pins workflows to their version, and replay tests validate new code against real histories. Step Functions versions state machines, so in-flight executions keep the old definition. Inngest deploys with your app, which is simple until a deploy changes a step's behaviour mid-run; keep step ids stable and treat step code as a contract, not an implementation detail.

The third trade-off is lock-in, and it is asymmetric. Temporal's workflows are code in your repository against an open-source server you can self-host — the exit is real. Step Functions' workflows are JSON that only AWS runs, and Inngest's orchestration state lives in its cloud even though the code is yours. That is not a reason to avoid either managed option, but it is a reason to keep the business logic inside steps and activities rather than in the orchestration layer, so a migration is a rewrite of the glue, not of the product.

And the trade-off teams forget: determinism and idempotency are your job, in all three. The engine guarantees the workflow resumes; it cannot guarantee a non-idempotent step is safe to replay, or that workflow code with a hidden Date.now() replays to the same decision. The first production incident with any of these tools is usually a step that charged twice or a replay that took a different branch. Write the idempotency key first, then the workflow.

Recommendation

Start with Step Functions if: you are already on AWS, the workflow fits a state machine without contorting, and you want the answer this week. Use Standard for anything long-running, audited, or waiting on a human, and Express only for short, high-volume, idempotent work. Keep payloads under 256 KiB by passing references, not data.

Start with Inngest if: your app is serverless or Next.js, your workflows are event-driven background jobs or agent loops, and you want durable execution without operating anything new. Stay inside the free tier while you learn the step model, and watch the concurrent-steps limit before you fan out.

Start with Temporal if: workflows run for days, span teams or services, need signals and queries mid-flight, or must survive deploys and restarts as a matter of correctness — order processing, payment sagas, onboarding flows, durable AI agents. Accept that you are operating workers and a server (or paying Cloud per action), and budget a week for the team to learn the determinism rules.

Which engine, in 30 seconds Answer one question: where does the work already live? Where does the work live? AWS-only · serverless · long-running? Step Functions AWS-only · JSON is fine Inngest serverless · event-driven Temporal long-running · multi-team If two answers fit, pick the one whose hosting you already pay for.

When NOT to use durable execution

Do not reach for a workflow engine when a queue and a retry loop will do. A single background job with one step — send the welcome email, resize the image — does not need a journal, a history, or a state machine; a queue with dead-letter handling is cheaper, simpler, and easier to debug. Do not adopt one for a process that never spans a crash boundary: if the whole thing runs in under a second inside one request, durability is overhead with no failure mode to fix.

Do not adopt Temporal when you have no long-running workflows yet — the server and the worker fleet are a platform, and platforms need owners. Do not buy into Step Functions if your workflows are mostly outside AWS; the integrations are the value, and without them you are paying for JSON. And do not pick Inngest for step-heavy batch work with hundreds of sequential steps — the per-step HTTP round-trips and execution counts add up, and a worker-based engine will be cheaper and faster.

If none of the three fits, the honest answer is often two tools: a queue for the fire-and-forget jobs, and one durable engine for the multi-step processes that must not lose state. The queue handles volume; the engine handles correctness.

What to do next

This week, pick the one process in your system that already loses state on a crash — the onboarding flow, the order pipeline, the agent loop — and model it in the engine that matches where the code already lives. Measure two numbers before you commit: how many steps the workflow has, and how long it sleeps. Step count decides the Inngest and Step Functions bill; sleep length decides whether Express is even possible. If the workflow waits on a human, start with Standard or Inngest and price the wait (on Step Functions Standard, it is free; on Inngest, the run just occupies one of your executions until it completes).

For the surrounding patterns, see our Step Functions patterns guide for the state shapes, our event-driven microservices guide for the event model Inngest plugs into, and our autonomous AI agents guide for the agent loops that benefit most from durable execution.

Why This Matters

Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

Trade-offs to Consider

Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

When NOT to Use This

Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

Decision Framework

Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

Share this articleShare on XShare on LinkedIn

Keep the decision frameworks coming

One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.