A normal Lambda function that has to wait pays for the wait. If your workflow extracts a document, then waits five minutes for a confirmation, the function sits there billing for all five minutes, and anything longer than the 15-minute limit does not fit at all. Lambda durable functions change that. The function checkpoints its progress, suspends while it waits, and resumes on a new invocation with its state intact.

I wanted numbers rather than the announcement, so I ran the same workflow both ways in my test account and measured what Lambda billed. I also tested the parts that matter once real users depend on it: human approvals, retries, deploying new code while executions are waiting, and the replay rule that can make a durable function quietly do the wrong thing.

Everything below comes from runs on 2026-11-19 in us-west-2, Python 3.14, x86, 512 MB, with aws-durable-execution-sdk-python 3.1.0. Costs are list prices without the free tier. The whole test cost under two cents.

TL;DR

  • Same workflow with a five-minute wait: the normal function was billed 303,118 ms, the durable function 3,405 ms across two invocations. Per run that is $0.00253 against $0.000077, about 33 times less.
  • Durable functions add a charge per operation ($8 per million). For a workflow with almost no waiting, the durable version cost 2.2 times more than the normal one ($0.0000768 against $0.0000343).
  • Setup is different in five places: durable mode is set only when you create the function, you must invoke a version or alias, the IAM managed policy is different, logs default to JSON, and you should bundle the SDK because the runtime ships an older major version (1.5.0 against 3.1.0).
  • An execution started on a published version resumed on its original code after I deployed new code. An execution started on $LATEST ran its first step on the old code and its last step on the new code.
  • Code that is not wrapped in a step runs again on every resume. In five cloud runs with an unsafe approval gate, four executed a different action than the one shown to the approver.

What changes compared to a normal Lambda

Normal Lambda Durable function
Longest single run 15 minutes (function timeout) Execution timeout up to about one year; each invocation still has the function timeout
Waiting time.sleep, billed for the whole wait context.wait or a callback; no duration charge while suspended
How it resumes It does not A new invocation replays the handler from the top and skips completed steps
Extra charges None $8 per million durable operations, $0.25 per GB written, $0.15 per GB-month retained
Enabling it Not applicable DurableConfig at creation; cannot be added to an existing function
Invoking Function name is enough Must invoke a version, alias or $LATEST; a bare name is rejected
IAM role AWSLambdaBasicExecutionRole AWSLambdaBasicDurableExecutionRolePolicy (logs plus checkpoint and state actions)
Default log format Text JSON

The cost test: the same five-minute workflow, two ways

The workflow is a small document pipeline: validate, extract (about 2 seconds of work), enrich (about 1 second), wait five minutes for a confirmation, then finalize. In the normal function the wait is a time.sleep(300). In the durable function it is context.wait(Duration.from_seconds(300)). Both functions had 512 MB.

Normal Lambda Durable function
Invocations 1 2
Billed duration 303,118 ms 3,259 ms + 146 ms = 3,405 ms
Compute $0.0025260 $0.0000284
Requests $0.0000002 $0.0000004
Durable operations (6) $0.0000480
Data written and retained (about 0.5 KB) $0.0000001
Total per run $0.0025262 $0.0000769
Per million runs (calculated) about $2,526 about $77

The six durable operations are the execution start, four steps and one wait. The data written is the step results and the input, about half a kilobyte here, so it barely registers.

Lambda bills a durable function only while one of its invocations is running, so the question is how long the invocations ran. The execution history answers that, because it records when each invocation ended. The first invocation ran the three steps, started the wait and ended about 3.3 seconds after the start. For the next five minutes no invocation was running, so nothing was billed. Then a second invocation started, replayed the handler, ran finalize and ended 174 ms later. Those two invocations are the 3,259 ms and 146 ms in the table:

ExecutionStarted 01:18:05.833 StepSucceeded validate 01:18:05.939 StepSucceeded extract 01:18:07.973 StepSucceeded enrich 01:18:09.012 WaitStarted await_confirmation 01:18:09.047 InvocationCompleted 01:18:09.163 first invocation ends WaitSucceeded await_confirmation 01:23:09.047 StepSucceeded finalize 01:23:09.146 InvocationCompleted 01:23:09.269 second invocation ends ExecutionSucceeded 01:23:09.269 

When the durable version costs more

The operation charge is fixed per execution, so it only pays off when there is real waiting. With a one-second wait, the normal function was billed 4,090 ms and cost $0.0000343. The durable function was billed 3,394 ms but cost $0.0000768, because its six operations alone cost $0.000048.

That gives a simple rule of thumb. Six operations cost the same as about 5.8 seconds of compute at 512 MB (and about 2.9 seconds at 1 GB). If your workflow waits longer than that, durable is cheaper. If it mostly computes and never waits, a normal function or a single invocation is cheaper.

Past the 15-minute limit

A normal function cannot wait 20 minutes, because its timeout stops at 900 seconds. The durable function with a 20-minute wait succeeded with two invocations billed 4,997 ms and 1,304 ms. The second one was slower because the function had been idle for 20 minutes and started cold. Total cost: $0.000101.

Setup, step by step, and where it differs

1. The role. Attach AWSLambdaBasicDurableExecutionRolePolicy. It covers CloudWatch Logs and adds lambda:CheckpointDurableExecution and lambda:GetDurableExecutionState, so you do not need the basic execution policy as well.

2. Bundle the SDK. The Python 3.14 runtime includes the durable SDK, but the copy it loaded was version 1.5.0, while the current release is 3.1.0. AWS recommends bundling it for production, and with a major-version gap that matters. My deployment package with the SDK was 167 KB; the SDK needs only boto3, which the runtime has.

3. Create the function with DurableConfig. This is the one setting you cannot fix later. I tried adding it to an existing normal function and got: "You cannot add a durable configuration to a function that was originally created with no durable configuration."

lam.create_function( FunctionName="dlab-durable", Runtime="python3.14", Role=role_arn, Handler="fn_durable.handler", Code={"ZipFile": zip_bytes}, Timeout=60, # per invocation, still capped at 900 MemorySize=512, DurableConfig={"ExecutionTimeout": 3600, "RetentionPeriodInDays": 1}, ) 

The two timeouts mean different things. Timeout limits each invocation, so it only needs to cover the longest stretch of work between waits; 60 seconds was plenty here. ExecutionTimeout limits the whole execution across all invocations and waits.

4. Publish a version and invoke it. Invoking the bare function name failed with "You cannot invoke a durable function using an unqualified ARN." Use a version or an alias. Use asynchronous invocation for anything long. A synchronous call to my function was refused with "You cannot synchronously invoke a durable function with an executionTimeout greater than 30 minutes."

lam.invoke( FunctionName="dlab-durable", Qualifier="3", # a version or alias InvocationType="Event", DurableExecutionName="order-cd2e485d", # optional, makes the start idempotent Payload=json.dumps(event).encode(), ) 

DurableExecutionName is worth setting. I started the same name twice, two seconds apart. Both calls returned the same execution ARN, and only one execution existed afterwards. That is the protection you want when a client retries after a timeout.

5. Write the handler. Wrap each unit of real work in a step, and use waits for waiting:

from aws_durable_execution_sdk_python import DurableContext, StepContext, durable_execution, durable_step from aws_durable_execution_sdk_python.config import Duration @durable_step def extract(step_ctx: StepContext, doc: dict) -> dict: ... # real work, runs once, result checkpointed return {"fields": fields} @durable_execution def handler(event, context: DurableContext): doc = {"doc_id": event["doc_id"], "pages": int(event["pages"])} context.step(validate(doc), name="validate") extracted = context.step(extract(doc), name="extract") enriched = context.step(enrich(extracted), name="enrich") context.wait(Duration.from_seconds(300), name="await_confirmation") return context.step(finalize(doc, enriched), name="finalize") 

6. Read the history. get_durable_execution gives the status and result, and get_durable_execution_history gives every step, wait, retry and invocation with timestamps and request IDs. The request IDs match the platform.report lines in CloudWatch Logs, which is how I got the billed duration of each invocation. The logs are JSON by default, so a filter for the text REPORT RequestId that works on normal functions finds nothing; filter for platform.report instead.

The replay rule

When a durable function resumes, Lambda runs the handler again from the top. Steps that already finished are not executed again; their saved results are returned. Code outside a step simply runs again.

That matters most in an approval gate. I ran one in the cloud two ways, with a stand-in agent that picks one of five actions at random, the way a model call can return a different answer each time. The unsafe version calls the agent outside a step:

proposal = agent_proposes() # outside a step: runs again on resume shown = context.step(show_to_human(proposal), name="show_to_human") context.wait(Duration.from_seconds(3), name="human_approval") executed = context.step(execute_action(proposal), name="execute") 

The safe version changes one line:

proposal = context.step(agent(), name="agent") # runs once, result saved 

Each run is one approval. The function asks the agent for an action, shows that action to the approver, waits, and then executes an action. The two columns that matter are what the approver saw and what the function actually executed. They should always be the same.

I ran each version five times, as five separate executions, because the stand-in agent picks at random. With five possible actions, a single unsafe run can match by luck one time in five, so one run would prove nothing.

Run Version Approver saw Function executed Same?
1 Unsafe request_info request_info yes (by luck)
2 Unsafe partial_refund refund no
3 Unsafe deny partial_refund no
4 Unsafe partial_refund escalate no
5 Unsafe escalate refund no
6 Safe escalate escalate yes
7 Safe request_info request_info yes
8 Safe partial_refund partial_refund yes
9 Safe escalate escalate yes
10 Safe request_info request_info yes

In the unsafe runs, the agent ran a second time after the wait and picked a new action, and that new action is what got executed. In the safe runs, the agent ran once, its answer was saved, and the same answer was used after the wait.

Every unsafe run finished with status SUCCEEDED. Four of the five executed something the approver never saw, and nothing in the status shows it. The one match was luck. The rule: anything that can return a different value or has a side effect goes inside a step. That includes model calls, API calls, timestamps, random values and IDs.

Human approval with a callback

For a real approval you do not want a timer, you want to wait until a person answers. A callback does that:

proposal = context.step(agent(), name="agent") cb = context.create_callback( name="human_approval", config=CallbackConfig(timeout=Duration.from_seconds(120)), ) context.step(notify_approver(cb.callback_id, proposal), name="notify_approver") raw = cb.result() # suspends until someone answers or the timeout passes decision = json.loads(raw) if isinstance(raw, str) else raw 

The approver, or whatever system they use, answers with one API call:

lam.send_durable_execution_callback_success( CallbackId=callback_id, Result=json.dumps({"approved": True, "approver": "lab-approver"}).encode(), ) 

What I saw:

  • I answered 20 seconds after the request. The execution resumed and executed the approved action, with two invocations billed 1,170 ms and 139 ms.
  • The result came back to the handler as a JSON string, not a dictionary. My first version called .get() on it and the execution failed with an AttributeError, so parse it.
  • A second answer to the same callback was rejected with CallbackTimeoutException: "The callback is either timed out or already completed." A double click on "approve" cannot approve twice.
  • With a 30-second timeout and no answer, the history recorded CallbackTimedOut at exactly 30 seconds, and the execution ended FAILED with CallbackTimeoutError. A late answer after that was rejected the same way.

Leave the timeout at its default and the callback has no timeout, so a forgotten request can hold an execution until the execution timeout. Set one, and catch CallbackTimeoutError so a missed approval escalates instead of failing silently.

Retries

Steps retry with backoff when you give them a retry strategy:

RETRY = StepConfig(retry_strategy=create_retry_strategy(RetryStrategyConfig( max_attempts=4, initial_delay=Duration.from_seconds(2), max_delay=Duration.from_seconds(10), backoff_rate=2.0, retryable_error_types=[ConnectionError], ))) first = context.step(expensive(), name="expensive") second = context.step(flaky(), name="flaky", config=RETRY) 

The flaky step failed on attempts 1 and 2 and succeeded on attempt 3, which the history records with StepFailed and RetryDetails for each attempt. Each retry ran in its own short invocation (130 ms and 149 ms billed), and the function was not running in between. The expensive step before it ran once: its result, including a random token, was the same at the end as after attempt 1.

Two things to know. Each attempt counts as a durable operation, so retries add a little cost. And the default step semantics are at least once per retry, so a step that charges a card or sends an email should be idempotent on its own, for example by passing an idempotency key to the downstream API.

Deploying while executions are waiting

This is the production question few posts answer. I started two executions that each run a step, wait 90 seconds and run another step, and both steps report the code version. One started on published version 2, one on $LATEST. While both were waiting, I deployed new code and published version 3.

Started on First step ran Step after the wait ran
Version 2 v1 code v1 code
$LATEST v1 code v2 code

The published version stayed on the code it started with. The $LATEST execution switched code in the middle of one execution. Here that only changed a label, but if the new code adds, removes or renames a step, replay will not line up with the saved history. Invoke a published version or an alias in production, keep old versions until their executions finish, and treat $LATEST as for testing only.

Production checklist

  • Invoke a published version or an alias, never $LATEST, and keep old versions until their executions drain.
  • Bundle the SDK and pin its version.
  • Put every model call, API call, timestamp, random value and side effect inside a step.
  • Make side-effecting steps idempotent; retries are at least once by default.
  • Set a callback timeout, and handle CallbackTimeoutError.
  • Set DurableExecutionName from a business key so client retries do not start duplicates.
  • Size the function timeout to the longest stretch of work between waits, and the execution timeout to the whole process.
  • Keep step results small; the limit is 1 MB per operation and every byte is written and retained.
  • Set RetentionPeriodInDays to what you need for audit (1 to 90 days, default 14), since retained data is billed.
  • Watch the durable metrics (DurableExecutionFailed, DurableExecutionTimedOut, DurableExecutionOperations) and alert on failures, because a wrong result can still show SUCCEEDED.
  • Define the function, version and alias in infrastructure as code, since durable mode cannot be added later.

Durable functions, Managed Instances or Step Functions

Durable functions fit a workflow that spends most of its time waiting: approvals, callbacks, scheduled delays, polling. They are the wrong tool for one continuous computation that is busy for a long time, because there is nothing to suspend. That case is Lambda Managed Instances, which I tested in I Ran a Lambda Function for 20 Minutes Straight. The short rule: if the clock is long because your code is waiting, use durable functions; if it is long because your code is busy, use Managed Instances.

Step Functions still makes sense when the workflow coordinates many AWS services, needs a visual definition, or must never depend on replay discipline in your own code. Durable functions keep the logic in one handler you can read top to bottom, and in exchange you own the replay rule.

What I did not test

High concurrency, payloads near the 1 MB limit, parallel and map operations, encryption with a customer key, arm64, and anything longer than 20 minutes. Each run used one workflow shape on one day in one Region, so measure your own workload before you take the cost ratio as given.